Re: auto_increment
| From: | Kapu | Date: | Tue, 07 Sep 2010 16:10:34 +0000 |
| Subject: | Re: auto_increment | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47371@lists.php.net to get a copy of this message | ||
You are missing a semicolon after the first alter statement.
Kapu
On 7. 9. 2010 18:05, Ron Piggott wrote:
I am receiving the following error Adriano: SQL query: ALTER TABLEstatsDROPvisitsCREATE TABLEstats2LIKEstats; MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLEstats2LIKEstats' at line 2 The complete commands were: ALTER TABLEstatsDROPvisitsCREATE TABLEstats2LIKEstats; ALTER TABLEstats2ADD COLUMNvisitsINT( 25 ) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY(visits) FIRST; INSERT INTOstats2SELECT *, 0 FROMstatsORDER BYinitial_access; I don't understand the error, your way of creating a table is new to me. Did something small get missed? Ron