The following query works fine when I do it phpmyadmin.
When I try to put it in my code though like so:
it gives me the following error:
Any thoughts?
Thanks,
Ron
Code:
DROP TABLE IF EXISTS tmp_price_compare;
CREATE TABLE IF NOT EXISTS tmp_price_compare (
supplier_reference varchar(32) DEFAULT NULL,
quantity int(10) NOT NULL DEFAULT '0',
price decimal(20,6) NOT NULL DEFAULT '0.000000',
wholesale_price decimal(20,6) NOT NULL DEFAULT '0.000000'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Code:
mysql_query("DROP TABLE IF EXISTS tmp_price_compare;
CREATE TABLE IF NOT EXISTS tmp_price_compare (
supplier_reference varchar(32) DEFAULT NULL,
quantity int(10) NOT NULL DEFAULT '0',
price decimal(20,6) NOT NULL DEFAULT '0.000000',
wholesale_price decimal(20,6) NOT NULL DEFAULT '0.000000'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;")
or die(mysql_error());
Code:
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 'CREATE TABLE IF NOT EXISTS tmp_price_compare ( supplier_reference varchar(32' at line 2
Thanks,
Ron