What is wrong with my SQL syntax here?

Posted by CT on Stack Overflow See other posts from Stack Overflow or by CT
Published on 2010-05-14T18:26:11Z Indexed on 2010/05/14 18:34 UTC
Read the original article Hit count: 264

Filed under:
|
|
|

New to SQL. I'm looking to create a IT asset database. Here is one of the tables created with php:

mysql_query("CREATE TABLE software(
id VARCHAR(30), 
PRIMARY KEY(id),
software VARCHAR(30),
key VARCHAR(30))")
or die(mysql_error());  
echo "Software Table Created.</br />";

This is the output from the browser when I run the script:

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 'VARCHAR(30))' at line 5

I am running a standard LAMP stack on Ubuntu Server 10.04.

Thank you.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about syntax