fejl i SQL tabel query.
Hejsa..
Hvorfor får jeg denne fejl:
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 'option VARCHAR(255) NOT NULL default '',
stock VARCHAR(255) NOT NULL default '',' at line 4
- når jeg kører denne her?:
CREATE TABLE IF NOT EXISTS product_options (
optionid INT UNSIGNED NOT NULL AUTO_INCREMENT,
productid INT UNSIGNED,
option VARCHAR(255) NOT NULL default '',
stock VARCHAR(255) NOT NULL default '',
price decimal(3,2) NOT NULL default '0.00',
PRIMARY KEY(optionid, productid)
) TYPE=MyISAM;
Alt ser da fuldstændigt regelret ud, eller hva'?
Hvorfor får jeg denne fejl:
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 'option VARCHAR(255) NOT NULL default '',
stock VARCHAR(255) NOT NULL default '',' at line 4
- når jeg kører denne her?:
CREATE TABLE IF NOT EXISTS product_options (
optionid INT UNSIGNED NOT NULL AUTO_INCREMENT,
productid INT UNSIGNED,
option VARCHAR(255) NOT NULL default '',
stock VARCHAR(255) NOT NULL default '',
price decimal(3,2) NOT NULL default '0.00',
PRIMARY KEY(optionid, productid)
) TYPE=MyISAM;
Alt ser da fuldstændigt regelret ud, eller hva'?
Kommentarer4
Det er næsten rigtigt. Du
CREATE TABLE IF NOT EXISTS `product_options` (
`optionid` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`productid` INT UNSIGNED,
`option` VARCHAR(255) NOT NULL default '',
`stock` VARCHAR(255) NOT NULL default '',
`price` decimal(3,2) NOT NULL default '0.00',
PRIMARY KEY(optionid, productid)
) TYPE=MyISAM;
Ja, se det undrer mig. Jeg
Det er fordi du bruger
Se http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html for yderligere detajler...
/Skou
Oh...