I'm running the following query throug a PHP script
DROP TABLE IF EXISTS `address`;CREATE TABLE `address` ( `Id`
int(11) NOT NULL auto_increment, `EntityId` int(11) NOT NULL,
`sStreet1` varchar(50), `sStreet2` varchar(50), `sCity`
varchar(50), `sLoc` varchar(50), `sPv` char(2), `sState`
varchar(50), `sZip` varchar(10), `sType` varchar(50),
`FiscalAddress` tinyint(1) NOT NULL, PRIMARY KEY (`Id`) );
I can run this query trough different clients (such as Navicat) without problems, but running this through PHP will output the following
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid import content: ' . mysql_error() . "\n\n";
$message .= 'Whole query: ' . $query;
die($message);
}
this will output the following:
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 address ( Id int(11) NOT NULL AUTO_INCREMENT, EntityId int(11) ' at line 2 Whole query: DROP TABLE IF EXISTS address; CREATE TABLE address ( Id int(11) NOT NULL AUTO_INCREMENT, EntityId int(11) NOT NULL, sStreet1 varchar(50), sStreet2 varchar(50), sCity varchar(50), sLoc varchar(50), sPv char(2), sState varchar(50), sZip varchar(10), sType varchar(50), FiscalAddress tinyint(1) NOT NULL, PRIMARY KEY (Id) );
what am I doing wrong???