smstromb Posted July 15, 2008 Share Posted July 15, 2008 This should be an easy fix but my eyes just cannot spot the error, it's driving me crazy: $sql = "CREATE TABLE $username ( id int NOT NULL AUTO_INCREMENT, PRIMARY KEY (id), FlightNumber varchar(5) NOT NULL, Date date NOT NULL, Approach varchar(100) NOT NULL, IMC smallint(6) NOT NULL, NightLandings smallint(6) NOT NULL, NightTime smallint(6) NOT NULL, Depart varchar(5) NOT NULL, Arrive varchar(5) NOT NULL, BlockTime smallint(6) NOT NULL, Aircraft varchar(10) NOT NULL, AircraftType varchar(10) NOT NULL, )"; mysql_query($sql,$this->connection); Link to comment https://forums.phpfreaks.com/topic/114750-solved-help-creating-table/ Share on other sites More sharing options...
rhodesa Posted July 15, 2008 Share Posted July 15, 2008 Date is a reserved word, don't use it as a column name ....also, this should be posted in mysql help Link to comment https://forums.phpfreaks.com/topic/114750-solved-help-creating-table/#findComment-590051 Share on other sites More sharing options...
smstromb Posted July 15, 2008 Author Share Posted July 15, 2008 Ah, Sorry. Was in such a rush I didn't even look for the mysql forum. Also, I changed Date to theDate and it's still giving me problems. Link to comment https://forums.phpfreaks.com/topic/114750-solved-help-creating-table/#findComment-590055 Share on other sites More sharing options...
.josh Posted July 15, 2008 Share Posted July 15, 2008 mysql_query($sql,$this->connection) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/114750-solved-help-creating-table/#findComment-590075 Share on other sites More sharing options...
smstromb Posted July 15, 2008 Author Share Posted July 15, 2008 problem solved. There's an extra comma right before the closing parenthesis. Link to comment https://forums.phpfreaks.com/topic/114750-solved-help-creating-table/#findComment-590092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.