...

View Full Version : mysql_query() gone wrong



rafiki
08-23-2007, 01:20 PM
mysql_query(CREATE TABLE `airport` (
`id` int(11) NOT NULL auto_increment,
`owner` varchar(40) NOT NULL default '',
`location` enum('England','China','France','Holland','USA','Germany','Canada','South Africa') NOT NULL default 'England',
`travel_prices` varchar(100) NOT NULL default '100-100-100-100-100-100-100-100',
`profit` varchar(100) NOT NULL default '0-0-0-0-0-0-0-0',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1);

is throwing an error
Parse error: parse error, unexpected T_STRING in /home/www/jamwes6.freehostia.com/123.php on line 3

Nightfire
08-23-2007, 01:41 PM
Looks like the closing bracket here to me

ENGINE=MyISAM DEFAULT CHARSET=latin1);

rafiki
08-23-2007, 01:43 PM
what about it? lol should be there shouldnt it

Nightfire
08-23-2007, 01:45 PM
Doh, I see what you've done. You've not put the query in quotes. I thought you was just posting the sql



mysql_query("CREATE TABLE `airport` (
`id` int(11) NOT NULL auto_increment,
`owner` varchar(40) NOT NULL default '',
`location` enum('England','China','France','Holland','USA','Germany','Canada','South Africa') NOT NULL default 'England',
`travel_prices` varchar(100) NOT NULL default '100-100-100-100-100-100-100-100',
`profit` varchar(100) NOT NULL default '0-0-0-0-0-0-0-0',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1");

rafiki
08-23-2007, 01:46 PM
doh shoulda caught it
thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum