vRoxaneCaldwellu
New Member
First, I'm just starting to learn MySQL with PHP.My query copy/paste directly from my IDE:\[code\]$query = "CREATE TABLE IF NOT EXISTS $table_messages ( id int(11) unsigned NOT NULL auto_increment, show tinyint(1) unsigned NOT NULL default '0', to varchar(255) NOT NULL default '', from varchar(255) NOT NULL default '', type varchar(255) NOT NULL default '', message varchar(255) NOT NULL default '', PRIMARY KEY(id) ) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1";$result = mysql_query( $query, $link ) OR exit ( mysql_error() );\[/code\]Results in this error:\[quote\] You have an error in your SQL syntax; near 'show tinyint(1) unsigned NOT NULL default '0' , to varchar(255) N' at line 4\[/quote\]... so I add one character to \[code\]show\[/code\] (e.g. \[code\]showz\[/code\]) and get this error:\[quote\] You have an error in your SQL syntax; near 'to varchar(255) NOT NULL default '' , from varchar(255) NOT NUL' at line 5\[/quote\]... so I add one character to \[code\]to\[/code\] (e.g. \[code\]toz\[/code\]) and get this error:\[quote\] You have an error in your SQL syntax; near 'from varchar(255) NOT NULL default '' , type varchar(255) NOT NU' at line 6\[/quote\]... so I add one character to \[code\]from\[/code\] (e.g. \[code\]fromz\[/code\]) and IT WORKS!?What is going on? LolIf this question is too blatantly obvious, I'll remove it if the community thinks it would be prudent, but in the meantime I'm stumped.BTW, I've messed with spacing, case and other things without any success.