Aaron4osu Posted December 21, 2011 Share Posted December 21, 2011 I'm getting an Error code: 1064 when I try to create the following table: It says it is at or near line 6 which is the email field. Any ideas? Also do I need the last line? ENGINE=MyISAM DEFAULT CHARSET=utf8;) This was taken from a tutorial that is a couple of years old. I'm using using MySQL Version: 5.1.56 CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(32) NOT NULL, `password` varchar(32) NOT NULL, `online` int(20) NOT NULL default ‘0', `email` varchar(100) NOT NULL, `active` int(1) NOT NULL default ‘0', `rtime` int(20) NOT NULL default ‘0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Quote Link to comment Share on other sites More sharing options...
premiso Posted December 21, 2011 Share Posted December 21, 2011 Two things I am seeing, the first is smart quotes in the default fields. Not sure if this is the problem. The second is an int(20). From what I recall, 11 is the max int size. I do not know if that would cause the error or not, but if you need it to be 20 slots, use BIGINT. http://dev.mysql.com/doc/refman/5.0/en/integer-types.html Do that and change those smart quotes and it should work: CREATE TABLE IF NOT EXISTS `users` ( `id` int(11) NOT NULL auto_increment, `username` varchar(32) NOT NULL, `password` varchar(32) NOT NULL, `online` bigint NOT NULL default '0', `email` varchar(100) NOT NULL, `active` tinyint(1) NOT NULL default '0', `rtime` bigint NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; See how that goes. Quote Link to comment Share on other sites More sharing options...
Aaron4osu Posted December 21, 2011 Author Share Posted December 21, 2011 That did it Thanks for the super quick response!!! Quote Link to comment Share on other sites More sharing options...
premiso Posted December 21, 2011 Share Posted December 21, 2011 Just to rub it in, I pwnt you Maq. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.