gibbyg100 Posted May 14, 2009 Share Posted May 14, 2009 Hi all, I'm a bit new to forums in general so this wont be very elegant Anyway my problem is that I am trying have a script file create at table in a database that was created. A similar script file with identical syntax went through without any problems however with this one I get: #1064 - 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 ''CourseCode' varchar(11) NOT NULL default '0', 'Status' int(11) NOT NULL defaul' at line 2 I am using the latest version of Wampserver 2.0 and I think that is MySQL 5.0. My experience of SQL is limited so I'm sorry if this seems a little lame. The script I want to input is as follows: CREATE TABLE Survey_Response ( 'CourseCode' varchar(11) NOT NULL default '0', (LINE 2 IS HERE) 'Status' int(11) NOT NULL default '0', 'Sector' int(11) NOT NULL default '0', 'Employer' int(11) NOT NULL default '0', 'JobTitle' varchar(11) NOT NULL default '0', 'Relevancy' int(11) NOT NULL default '0', 'Location' int(11) NOT NULL default '0', 'Salary' int(11) NOT NULL default '0', ); CREATE TABLE Survey_Repsonse_Totals ( 'Employed' INT NOT NULL, 'Further Study' INT NOT NULL, 'Unemployed' INT NOT NULL, 'Banking/Finance' INT NOT NULL, 'Vetinery' INT NOT NULL, 'Medicine' INT NOT NULL, 'Childcare' INT NOT NULL, 'Agriculture' INT NOT NULL, 'Pharmacuticals' INT NOT NULL, 'Other' INT NOT NULL, 'Ireland-South' INT NOT NULL, 'Ireland-East' INT NOT NULL, 'Ireland-West' INT NOT NULL, 'Ireland-North' INT NOT NULL, 'Dublin' INT NOT NULL, 'Northern Ireland' INT NOT NULL, 'Abroad' INT NOT NULL, 'Most Relevant' INT NOT NULL, 'Relevant' INT NOT NULL, 'Unsure' INT NOT NULL, 'Irrelevant' INT NOT NULL, 'Most Irrelevant' INT NOT NULL, 'Up_to_€12,999' INT NOT NULL, '€13,000_€16,999' INT NOT NULL, '€17,000_€20,999' INT NOT NULL, '€21,000_€24,999' INT NOT NULL, '€25,000_€28,999' INT NOT NULL, '€29,000_€32,999' INT NOT NULL, '€33,000_€36,999' INT NOT NULL, '€37,000_€40,999' INT NOT NULL, '€41,000+'INT NOT NULL, ); Any help would be appreciated Quote Link to comment https://forums.phpfreaks.com/topic/158120-script-file-returning-errors/ Share on other sites More sharing options...
Mchl Posted May 14, 2009 Share Posted May 14, 2009 Use `` around column names not '' Quote Link to comment https://forums.phpfreaks.com/topic/158120-script-file-returning-errors/#findComment-834039 Share on other sites More sharing options...
gibbyg100 Posted May 14, 2009 Author Share Posted May 14, 2009 Thats something that I forgot to mention, the error says or claims I used double quotes when in fact i did not(as per the script file) ??? Also thanks for the quick reply Quote Link to comment https://forums.phpfreaks.com/topic/158120-script-file-returning-errors/#findComment-834047 Share on other sites More sharing options...
Mchl Posted May 14, 2009 Share Posted May 14, 2009 It's not a double quote. The error message starts with one single quote ' and then your query is displayed in the place where error occurred, which coincidentally is also a single quote ' and in result it look like double quote '' But the error is casued because you use single quotes ' around column names, while you should use either backticks ` or nothing at all. Quote Link to comment https://forums.phpfreaks.com/topic/158120-script-file-returning-errors/#findComment-834055 Share on other sites More sharing options...
gibbyg100 Posted May 14, 2009 Author Share Posted May 14, 2009 Ahhhhhh I see Thanks for that I'll try it out! Quote Link to comment https://forums.phpfreaks.com/topic/158120-script-file-returning-errors/#findComment-834088 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.