Jump to content

[SOLVED] ERROR IN "CREATE TABLE"


d22552000

Recommended Posts

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

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...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.