Whats wrong w/this code? I can't see a problem w/it but i'm getting this error
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 `superusers` ( `id` int( 11 )
NOT NULL AUTO_INCR
Here's the actual code:
<?php
include("config.php"); // Defines server vars, db_user, localhost, pass and such
include("dbcnx.php"); // connects to mysql server, selects the db i am wanting to work with
$sql = 'CREATE TABLE `bannedips` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT ,'
. ' `banned` varchar( 55 ) default NULL ,'
. ' PRIMARY KEY ( `id` ) ) TYPE = MYISAM ;'
. ' CREATE TABLE `superusers` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT ,'
. ' `supername` varchar( 20 ) NOT NULL default \'\','
. ' `superpass` varchar( 11 ) default NULL ,'
. ' `superurl` varchar( 50 ) default NULL ,'
. ' `auth_level` varchar( 11 ) NOT NULL default \'1\','
. ' PRIMARY KEY ( `id` ) ) TYPE = MYISAM AUTO_INCREMENT =2;'
. ' INSERT INTO `superusers` '
. ' VALUES ( 1, \'demo\', \'demopass\', \'http://www.deadlysin3.net\', \'2\' ) ;'
. ' CREATE TABLE `tagit` ( `id` int( 11 ) NOT NULL AUTO_INCREMENT ,'
. ' `tagitname` varchar( 50 ) NOT NULL default \'\','
. ' `tagitpost` text NOT NULL ,'
. ' `tagiturl` varchar( 50 ) NOT NULL default \'\','
. ' `tagitdate` varchar( 50 ) default NULL ,'
. ' `tagitip` varchar( 20 ) NOT NULL default \'127.0.0.1\','
. ' `tagitflood` datetime NOT NULL default \'0000-00-00 00:00:00\','
. ' PRIMARY KEY ( `id` ) ) TYPE = MYISAM ;'
. ' ';
$result = mysql_query($sql);
if(!$result) { die(mysql_error()); }
else { echo "Successful creation of tables!"; }
mysql_close($dbQuery);
?>