d22552000 Posted December 1, 2007 Share Posted December 1, 2007 Here is my MYSQL query: mysql_query("CREATE TABLE `phpbb2_auth_access` ( `group_id` mediumint( NOT NULL default '0', `forum_id` smallint(5) unsigned NOT NULL default '0', `auth_view` tinyint(1) NOT NULL default '0', `auth_read` tinyint(1) NOT NULL default '0', `auth_post` tinyint(1) NOT NULL default '0', `auth_reply` tinyint(1) NOT NULL default '0', `auth_edit` tinyint(1) NOT NULL default '0', `auth_delete` tinyint(1) NOT NULL default '0', `auth_sticky` tinyint(1) NOT NULL default '0', `auth_announce` tinyint(1) NOT NULL default '0', `auth_vote` tinyint(1) NOT NULL default '0', `auth_pollcreate` tinyint(1) NOT NULL default '0', `auth_attachments` tinyint(1) NOT NULL default '0', `auth_mod` tinyint(1) NOT NULL default '0', KEY `group_id` (`group_id`), KEY `forum_id` (`forum_id`) ) CREATE TABLE `phpbb2_banlist` ( `ban_id` mediumint( unsigned NOT NULL auto_increment, `ban_userid` mediumint( NOT NULL, `ban_ip` char( NOT NULL, `ban_email` varchar(255) default NULL, PRIMARY KEY (`ban_id`), KEY `ban_ip_user_id` (`ban_ip`,`ban_userid`) ) AUTO_INCREMENT=1 ; BUNCH OF OTHER SQL") or die(mysql_error()); Here is what the page tells me: 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 `phpbb2_banlist` ( `ban_id` mediumint( unsigned NOT NULL auto_' at line 20 Please tell me what the problem is. I am incredibly confused. P.S. The database shows 0 tables after the page is run. Link to comment https://forums.phpfreaks.com/topic/79631-solved-error-in-create-table/ Share on other sites More sharing options...
toplay Posted December 1, 2007 Share Posted December 1, 2007 Please post in the right form area. This is going to be moved to mysql help. In PHP, the mysql_query() can only run one query at a time. You have two. FYI - Make sure the MySQL user login you're using has create privileges. Link to comment https://forums.phpfreaks.com/topic/79631-solved-error-in-create-table/#findComment-403289 Share on other sites More sharing options...
xProteuSx Posted December 1, 2007 Share Posted December 1, 2007 Check all your ' , (), and ". It seems that you have complicated the entire process. You can eliminate a lot of these characters, and thereby solve your problem. Link to comment https://forums.phpfreaks.com/topic/79631-solved-error-in-create-table/#findComment-403290 Share on other sites More sharing options...
d22552000 Posted December 1, 2007 Author Share Posted December 1, 2007 I did not know that it could only do one query at a time.. which would explain my problem. and this is PHP mysql because the ENTIRE file is php LOL calling mysql. It turns out php was my problem. I have split EVERY insert and EVERY create to its own mysql query, and it works now. I might run into an erorr soon so I won't press topic solved untill my test run finishes... Link to comment https://forums.phpfreaks.com/topic/79631-solved-error-in-create-table/#findComment-403292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.