| | |
Mysql edit
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 8
Reputation:
Solved Threads: 1
Hi knrakesh,
I don't think it can be done - easily at least (quote taken from http://dev.mysql.com/doc/refman/5.0/...-sql-mode.html):
Adnan
•
•
•
•
Hello friends,
i copied a table from other database and using in other database, when iam using the same table in other database the primary key in the table is just auto increamenting from the past table only.
i want it to start from 0
•
•
•
•
NO_AUTO_VALUE_ON_ZERO
NO_AUTO_VALUE_ON_ZERO affects handling of AUTO_INCREMENT columns. Normally, you generate the next sequence number for the column by inserting either NULL or 0 into it. NO_AUTO_VALUE_ON_ZERO suppresses this behavior for 0 so that only NULL generates the next sequence number.
This mode can be useful if 0 has been stored in a table's AUTO_INCREMENT column. (Storing 0 is not a recommended practice, by the way.) For example, if you dump the table with mysqldump and then reload it, MySQL normally generates new sequence numbers when it encounters the 0 values, resulting in a table with contents different from the one that was dumped. Enabling NO_AUTO_VALUE_ON_ZERO before reloading the dump file solves this problem. mysqldump now automatically includes in its output a statement that enables NO_AUTO_VALUE_ON_ZERO, to avoid this problem.
•
•
Join Date: Aug 2008
Posts: 381
Reputation:
Solved Threads: 33
Did you copy the table structure or copy the table and all of its records too?
Because if you copied the records, you are not going to get a new key-sequence with existing records.
Copy the table structure only if you want to start over with new records.
Or I'm not understanding your problem clearly ?
Because if you copied the records, you are not going to get a new key-sequence with existing records.
Copy the table structure only if you want to start over with new records.
Or I'm not understanding your problem clearly ?
Google is the answer to all of your questions -- the trick is knowing what question to ask in your specific predicament.
![]() |
Similar Threads
- C++ and MySQL connection (C++)
- Retrieve data from a table in mysql and edit the contents (PHP)
- How do I install Apache, MySQL, PHP on Linux? (PHP)
- php connection to mysql headache (PHP)
- php mysql help (PHP)
Other Threads in the PHP Forum
- Previous Thread: question about upload php files
- Next Thread: Error with db manage form
| Thread Tools | Search this Thread |
.htaccess alexa apache api array beginner beneath binary broadband broken cakephp checkbox class cms code convert cron curl database date display dynamic echo email emptydisplayvalue encode error fcc file files folder form forms function functions google howtowriteathesis href htaccess html image images include insert ip javascript joomla key keywords limit link login mail mail() memberships menu mlm multiple multipletables mysql mysql_real_escape_string network oop open passwords paypal pdf php provider query radio random redirect remote rss script search securephp server sessions smtp source space sql strip_tags syntax system table template tutorial update upload url user validator variable video voteup web youtube





