abhorsen Posted August 19, 2006 Share Posted August 19, 2006 I am trying to creat a table, after 2 hours of messing about trying to get phpmyadmin to work I gave up and used the program recommened by my hosting company (fasthosts). This connected in like 2 mins :) but when trying to creat a table, (based of the "Creating a Membership System with PHP and MySQL[url=http://www.phpfreaks.com/tutorials/40/1.php]http://www.phpfreaks.com/tutorials/40/1.php[/url]" on this site)I get the following syntax error[code]An error occurred creating the Table. Server Error: 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 ''1' '2' '3') NOT NULL DEFAULT '0', `signup_date` datetime NOT NULL, `last_lo' at line 10QUERY: CREATE TABLE `Membership_Information` ( `userid` integer (25) NOT NULL auto_increment, `first_name` varchar (25) NOT NULL, `last_name` varchar (25) NOT NULL, `email_address` varchar (25) NOT NULL, `username` varchar (25) NOT NULL, `password` varchar (25) NOT NULL, `info` text NOT NULL, `user_level` enum('0' '1' '2' '3') NOT NULL DEFAULT '0', `signup_date` datetime NOT NULL, `last_login` datetime NOT NULL, `activated` enum('0' '1') NOT NULL DEFAULT '0', `user_image` varchar (50) NOT NULL, `user_country` varchar (50) NOT NULL, PRIMARY KEY (`userid`)) TYPE=MyISAM[/code]AS far as i can tell when compearing the code to that in the how to gude it looks right, but beeign stuck using [url=http://www.dbtools.com.br/EN/index.php]http://www.dbtools.com.br/EN/index.php[/url] I can not tell if there is something else i am missing out.[url=http://www.thingstodobeforeidie.co.uk/error.jpg]http://www.thingstodobeforeidie.co.uk/error.jpg[/url] screen shot, just incase soem one can see some thing i am missing, thanks in advance. Link to comment https://forums.phpfreaks.com/topic/18056-creating-a-table/ Share on other sites More sharing options...
AndyB Posted August 19, 2006 Share Posted August 19, 2006 You need to separate each of the ENUM values with a comma NOT a space Link to comment https://forums.phpfreaks.com/topic/18056-creating-a-table/#findComment-77368 Share on other sites More sharing options...
abhorsen Posted August 19, 2006 Author Share Posted August 19, 2006 thanks for the help, that seems to have worked in so much as the error has now changed.[code]Executing Query. Wait ...MySQL 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 'QUERY: CREATE TABLE users ( `userid` INT (25) NOT NULL, `first_name` varchar (' at line 1QUERY:QUERY: CREATE TABLE users ( `userid` INT (25) NOT NULL, `first_name` varchar (25) NOT NULL DEFAULT ' ', `last_name` varchar (25) NOT NULL DEFAULT '', `email_address` varchar (25) NOT NULL DEFAULT '', `username` varchar (25) NOT NULL DEFAULT '', `password` varchar (255) NOT NULL DEFAULT '', `info` text NOT NULL, `user_level` enum('0','1','2','3') NOT NULL DEFAULT '0', `signup_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `activated` enum('0','1') NOT NULL DEFAULT '0', `user_image` varchar (50) NOT NULL DEFAULT '', `user_country` varchar (50) NOT NULL DEFAULT '', PRIMARY KEY (`userid`)) TYPE=MyISAM comment='Membership information'[/code] Link to comment https://forums.phpfreaks.com/topic/18056-creating-a-table/#findComment-77379 Share on other sites More sharing options...
fenway Posted August 20, 2006 Share Posted August 20, 2006 I see nothing wrong with that. Link to comment https://forums.phpfreaks.com/topic/18056-creating-a-table/#findComment-77418 Share on other sites More sharing options...
abhorsen Posted August 20, 2006 Author Share Posted August 20, 2006 nether can I, will ahve to ahve a play with myphpadmin and see if ic an get that to connect, the main prolbem i am having with that is that my web hosting is on seprate server to my sql server, so my phpadmin is not really likeing it :( thanks for the help any way. Link to comment https://forums.phpfreaks.com/topic/18056-creating-a-table/#findComment-77489 Share on other sites More sharing options...
abhorsen Posted August 20, 2006 Author Share Posted August 20, 2006 Guys thanks to thouse who offered help, I sat back down this morning and just did exactly the same thing as i did yesterday, but it worked the code looks the same and every thing, I havent a clue as to why i was having so much trouble but thanks for the help any way at least I have table now, now for the hard part :). Link to comment https://forums.phpfreaks.com/topic/18056-creating-a-table/#findComment-77508 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.