Jump to content

Script file returning errors


gibbyg100

Recommended Posts

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  ;)

Link to comment
https://forums.phpfreaks.com/topic/158120-script-file-returning-errors/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.