Re: [PHP-DB] auto_increment

[email protected] ("Ron Piggott")
Newsgroups php.db
Message-ID <ed09e82a901539459ae750593ea3e67e.squirrel@www.theverseoftheday.info>
I am receiving the following error Adriano:

SQL query:

ALTER TABLE `stats` DROP `visits` CREATE TABLE `stats2` LIKE `stats` ;

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 TABLE `stats2` LIKE `stats`' at line 2

The complete commands were:

ALTER TABLE `stats` DROP `visits`
CREATE TABLE `stats2` LIKE `stats`;
ALTER TABLE `stats2` ADD COLUMN `visits` INT( 25 ) NOT NULL
AUTO_INCREMENT, ADD PRIMARY KEY(`visits`) FIRST;
INSERT INTO `stats2` SELECT *, 0 FROM `stats` ORDER BY `initial_access`;

I don't understand the error, your way of creating a table is new to me. 
Did something small get missed?

Ron
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.