Jump to content

Creating a table


abhorsen

Recommended Posts

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 10

QUERY: 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

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 1

QUERY:

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

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

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.