mysql

How to alter the auto_increment of a mysql-table using Doctrine

Hi, the question says it all it think :-) What is the best way to execute a query such as: ALTER TABLE tablename AUTO_INCREMENT = 1; using Doctrine? ...

PHP connecting Oracle and mySQL

I' trying to get some data from Oracle via ODBC to mySQL database. And then Insert some lines in mySQL database. I manage to list the lines from ORACLE but fail to Insert into mySQL. $time_start = microtime(true); set_time_limit(10000); //ligação ODBC ORACLE $connect = odbc_connect("acatex32", "acatex", "acatex"); $query = "select b...

How can I convert German characters during XML read and PHP write into mysql?

Morning, I am inputting data from an XML file into my database, but have any isse with German words (that are in the XML by mistake) For example the word für appears in my XML as für and thus appears the same in my database. I know I could do a simple search/replace for that exact phrase, but I was wondering if there was a smarter wa...

Improve speed of a JOIN in MySQL

Dear all, I know there a similar threads around, but this is really the first time I realize that query speed might affect me - so it´s not that easy for me to really make the transfer from other folks problems. That being said I have using the following query successfully with smaller data, but if I use it on what are mildly large t...

how can i implement this concept using mysql ?

My aim is to make a procedure that take a text -may contain idioms- as an input and it is output should be that text after replacing each idiom with it's meaning that their is a table called "idioms" which has two columns : the first is for idiom called "idiom" and the second is for idiom meaning and called "idiomMeaning" and this is my ...

Rails & MySQL - Saved HTML Being Truncated at HTML Entity

I'm saving whole HTML documents in the database with ActiveRecord. I can see in the logs that correct INSERT statements are being generated and sent to MySQL but when I actually look in the database after the save has completed, the content is truncated. It appears that   entities in the document are causing this truncation. I can ...

In a One to One relationship should i drop one of the table's id column?

I have the following 2 tables in MySQL: Customer(Id, Firstname, Lastname...) Bonus(Id, CustomerId, Value, ...) The relation is One-To-One, every customer has only one bonus.(the CustomerId is unique in the Bonus Table) Q: Should I drop the Id column of the Bonus table? (I want to know why or why not) ...

Why I cannot create DB in MySQL throw PHP?

I have this code: $link = mysql_connect("localhost", "ctmanager", "blablabla"); if ( ! $link ) die ("I cannot connect to MySQL.<br>\n"); else print "Connection is established.<br>\n"; // Create the "ct" database. mysql_query("create database ct", $link) or die("I cannot create the DB: ".mysql_error()."<br>\n"); And I get thi...

Voting using Appcelerator Titanium and website

I want to capture peoples votes on both a website and in an app using appcelerator Titanium. Still a bit of a newbie and am looking for the best way to capture the votes and store them in some kind of database, probably mySQL. Any thoughts? ...

mysql queries - performance loss by putting numbers in quotes?

If a variable will always be a number, is there a performace loss by putting it in inverted commas? for example "SELECT prod.product_name FROM prod WHERE prod.id = '$id'"; ...

Failed to execute stored procedure from the JDBC code using mysql connection

Hi, I have one database. I executed a stored procedure on it. I wrote some JDBC code to connect to this database. When I am calling this stored procedure from my JDBC code it is throwing SQLException. One interesting thing I found is that I have one user other than root user. This user has all the privileges to this database where th...

CASE + IF MysQL query

Problem is as follows. I have a product that can be in one of three categories (defined by category_id). Each category table has category_id field related to category_id in product table. So I have 3 cases. I'm checking If my product.category_id is in table one. If yes, I take some values. If not I check in tables that are left. What can...

I want to add and remove items from a menu with PHP.

This menu will need to be updated daily. <html><head></head><body> <h1> Welcome to Burgerama </h1> <?php include("menuBuilder.php"); showBurgerMenu(); ?> </body></html> Menu items are stored in the database. Items have a display field; if it is on, the item should be displayed on the menu. The menu only displays 4 or 5 "specials"...

Where to place web server root?

Hello everybody, I've just made an upgrade and now partly thinking on web-server directory structure for local workstation for web-development on linux platform. Running multiple hosts and different projects required. Where is it better to put all the server's docroots? /var/www? /srv? /www? I plan to make it as separate partition - cou...

Opening the Table from the Database

Am new to MySQL 5.1 In MySQL Where i can i find the Database & Table.... I was attached one database in MYSQL through odbc connectivity, How can i get that table values from the attached database. And also i want to create a table from the database.. ...

Which are the RDBMS that minimize the server roundtrips? Which RDBMS are better (in this area) than MS SQL?

IMPORTANT NOTE: I recieved many answers and I thank you all. But all the answers are more comments than answers. My question is related on the number of roundtrips per RDBMS. An experienced person told me that MySQL has less roundtrips than Firebird. I would like that the answer stays in the same area. I agree that this is not the first ...

What to use as "spam-filter" when sending emails with PHP mail() ?

I have a classifieds website, and on each classifieds page, there is a form for tipping a friend where you just enter the persons email-adress and the tip will then be sent. The form is submitted to tip.php where all "magic" happens with checking and sanitizing etc etc... Lastly I use php:s mail() function to send the email from tip.php...

Mysql insert into 2 tables

I want to make a insert into 2 tables visits: visit_id int | card_id int registration: registration_id int | type enum('in','out') | timestamp int | visit_id int i want something like: INSERT INTO `visits` as v ,`registration` as v (v.`visit_id`,v.`card_id`,r.`registration_id`, r.`type`, r.`timestamp`, r.`visit_id`) VALUES (NU...

Denormalization of large text?

If I have large articles that need to be stored in a database, each associated with many tables would a NoSQL option help? Should I copy the 1000 char articles over multiple "buckets", duplicating them each time they are related to a bucket or should I use a normalized MySQL DB with lots of Memcache? ...

MySQL temp table issue

Hi folks! I'm trying to use temp tables to speed up my MySQL 4.1.22-standard database and what seems like a simple operation is causing me all kinds of issues. My code is below.... CREATE TEMPORARY TABLE nonDerivativeTransaction_temp ( accession_number varchar(30), transactionDateValue date) ) TYPE=HEAP; INSERT INTO nonDerivativ...