I have this (for me bizarre) problem. The following code:
Code: Select all
$link = mysql_connect($config['db_host'], $config['db_user'], $config['db_pass']) or die(mysql_error());
mysql_select_db($config['db_db'], $link) or die(mysql_error);
$result = mysql_query("
DROP TABLE IF EXISTS `context`;
CREATE TABLE `context` (
`contextId` int(10) unsigned NOT NULL auto_increment,
`name` char(50) NOT NULL default '',
`description` char(100) NOT NULL default '',
PRIMARY KEY (`contextId`)
) ENGINE=MyISAM;
") or die(mysql_error());But if I use the exact same sql-statements in a MySql-client I don't get any errors.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 `context` ( `contextId` int(10) unsigned NOT
Please also note that the connection is working properly, so it is not that that's messing up my code.
Any clues?