jeff5656 Posted November 17, 2008 Share Posted November 17, 2008 Cannot see what is wrong with my code. I get this error" 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 'vachar(20) NOT NULL, icufellow varchar(20) NOT NULL, icustaff varchar(20) NO' at line 4" <?php include ("connectdb.php"); $sql = "CREATE TABLE staffsched ( which_date int(254) NOT NULL, which_month vachar(20) NOT NULL, icufellow varchar(20) NOT NULL, icustaff varchar(20) NOT NULL, f2staff varchar(20) NOT NULL, intervent varchar(20) NOT NULL, wb_ipd varchar(20) NOT NULL, lung_tx varchar(20) NOT NULL, phtn varchar(20) NOT NULL, warren varchar(20) NOT NULL, edit_date datetime NOT NULL, PRIMARY KEY (`which_date`) )"; // Execute query mysql_query($sql) or die(mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/133005-sql-syntax-error/ Share on other sites More sharing options...
genericnumber1 Posted November 17, 2008 Share Posted November 17, 2008 which_month vachar(20) NOT NULL, should be which_month varchar(20) NOT NULL, Link to comment https://forums.phpfreaks.com/topic/133005-sql-syntax-error/#findComment-691778 Share on other sites More sharing options...
jeff5656 Posted November 17, 2008 Author Share Posted November 17, 2008 oops! Thanks. Link to comment https://forums.phpfreaks.com/topic/133005-sql-syntax-error/#findComment-691780 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.