whats wrong with this query?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jose Arce
Forum Commoner
Posts: 37
Joined: Wed May 01, 2002 5:05 pm

whats wrong with this query?

Post by Jose Arce »

Code: Select all

$query="CREATE TABLE $name(id INT(4) NOT NULL AUTO_INCREMENT,asd VARCHAR(4),asd1 VARCHAR(10), asd2 VARCHAR(10),asd3 VARCHAR(10), asd3 VARCHAR(10), KEY (id))";
$create=mysql_query($query) or die("Falló la petición");

Anyone?

Thx:D
User avatar
QWERTY
Forum Newbie
Posts: 20
Joined: Sat Jun 29, 2002 10:57 am
Location: Slovenia

...

Post by QWERTY »

I dont' realy know, but try with quotes around $name.

Code: Select all

'$name'
And to this:

Code: Select all

$create=mysql_query($query) or die("Falló la petición" . mysql_error());
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

You have used the column name asd3 twice.
Post Reply