Web Hosting Talk







View Full Version : MySQL syntax error.. I can't figure out the problem here


Josh1billion
02-19-2006, 08:47 PM
Apparently, I have an error in my SQL syntax. I've been looking at this for some time now and I can't find out what the problem is. Hopefully one of you can figure it out.

Here's the line:

CREATE TABLE `test_banlist` (`ban_id` mediumint(8) unsigned NOT NULL auto_increment,ban_userid` mediumint(8) NOT NULL default '0',`ban_ip` varchar(8) NOT NULL default '',`ban_email` varchar(255) default NULL,PRIMARY KEY (`ban_id`),KEY `ban_ip_user_id` (`ban_ip`,`ban_userid`)) TYPE=MyISAM AUTO_INCREMENT=1 ;

The error message:

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 ' mediumint(8) NOT NULL default '0',`ban_ip` varchar(8) NOT NULL

arkin
02-19-2006, 10:15 PM
Your ban_userid needs an extra `

`ban_userid`

Josh1billion
02-19-2006, 10:39 PM
Nice, thanks. That fixed the problem. But of course I'm running into some other problems.. haha. I'll try to fix these myself before posting them.

Josh1billion
02-19-2006, 11:00 PM
Well, I fixed the next problem I had and then.. it did the next 20-something queries without a single further problem! Everything is going so well now.. my free phpBB hosting will be up within a week probably, at lunarzone.net. :) With only one tiny ad too (see http://tumeden.lunarzone.net/forums/ for an example of how small the ad is) and it'll have a lot of nice mods and templates and stuff.

WOOT.. I'm excited about this now. Thanks again for the help, Arkin!