Current location: Hot Scripts Forums » Programming Languages » PHP » Error in MysQL code: Pls Help


Error in MysQL code: Pls Help

Reply
  #1 (permalink)  
Old 03-16-06, 04:49 PM
Anzar Anzar is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Error in MysQL code: Pls Help

i am a complete newbie and want to install a chat on my site...

when i go to put this table in:

Quote:
CREATE TABLE forum_areas (
id tinyint(4) NOT NULL auto_increment,
name varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
last_update int(11) default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Forum Catagories';


CREATE TABLE forum_posts (
id int(11) NOT NULL auto_increment,
topic_id int(11) NOT NULL default '0',
board_id int(11) NOT NULL default '0',
post text NOT NULL,
username varchar(255) NOT NULL default '',
date int(11) NOT NULL default '0',
edit_date int(11) NOT NULL default '0',
last_update int(11) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Forum Replies';


CREATE TABLE forum_topics (
id int(11) NOT NULL auto_increment,
board_id int(11) NOT NULL default '0',
subject varchar(255) NOT NULL default '',
post text NOT NULL,
username varchar(255) NOT NULL default '',
date varchar(255) NOT NULL default '0',
edit_date int(11) NOT NULL default '0',
last_update varchar(255) NOT NULL default '0',
veiws varchar(255) NOT NULL default '0',
post_icon varchar(255) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Forum Topics';


CREATE TABLE im (
id bigint(20) NOT NULL auto_increment,
sentto varchar(255) NOT NULL default '0',
sender varchar(255) NOT NULL default '0',
message longtext NOT NULL,
subject varchar(255) NOT NULL default '(No Subject)',
status text NOT NULL,
date bigint(20) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;


CREATE TABLE news (
id int(11) NOT NULL auto_increment,
subject varchar(255) NOT NULL default '',
poster varchar(22) NOT NULL default '',
date date NOT NULL default '0000-00-00',
message text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;

CREATE TABLE users (
id int(11) NOT NULL auto_increment,
username varchar(22) NOT NULL default '',
password varchar(32) NOT NULL default '',
email_address varchar(155) NOT NULL default '',
nickname varchar(255) NOT NULL default '',
user_level enum('0','1','2','3','4',5') NOT NULL default '0',
forum_posts int(11) NOT NULL default '0',
profile text NOT NULL,
siggy varchar(255) NOT NULL default '',
last_post varchar(155) NOT NULL default '0',
last_login varchar(12) NOT NULL default '0',
style varchar(55) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;
it gives me a error at the end saying quote not closed or somthing for the last table "Users"
can some one please help?
Reply With Quote
  #2 (permalink)  
Old 03-16-06, 05:32 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
There's a quote missing. Try this

Code:
CREATE TABLE users (
id int(11) NOT NULL auto_increment,
username varchar(22) NOT NULL default '',
password varchar(32) NOT NULL default '',
email_address varchar(155) NOT NULL default '',
nickname varchar(255) NOT NULL default '',
user_level enum('0','1','2','3','4','5') NOT NULL default '0',
forum_posts int(11) NOT NULL default '0',
profile text NOT NULL,
siggy varchar(255) NOT NULL default '',
last_post varchar(155) NOT NULL default '0',
last_login varchar(12) NOT NULL default '0',
style varchar(55) NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;
Reply With Quote
  #3 (permalink)  
Old 03-16-06, 05:47 PM
ben.periton ben.periton is offline
Wannabe Coder
 
Join Date: Oct 2004
Posts: 183
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
it gives me a error at the end saying quote not closed or somthing for the last table "Users" can some one please help?
Im not trying to be funny, but if you read the errors that MySQL sends back, they are usually pretty informative, it says that there is a quote not closed in the end table "Users", so a quick glance at Users and we see a missing ' around the 5.

It just seems a lot of effort to go to a forum, post a message, wait for a reply and then fix, when it could be done easily by just reading the error!
__________________
Ben Periton
http://ben.periton.co.uk
Reply With Quote
  #4 (permalink)  
Old 03-16-06, 06:28 PM
Anzar Anzar is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for that man,
really appreiciate your help

xtech, iv jus really been stressed and did read throught it 2 times, but as i said
i am a newbie i have no knowledge of it lol so never knew
next time i will be more concentrated when going throught the
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Storing PHP code in mysql perleo PHP 1 09-17-05 11:40 AM
where do i edit for mysql in this code supaland PHP 2 03-24-04 05:13 AM
Generating PHP code for MySQL ptesone General Advertisements 1 02-03-04 08:26 AM
Any Code For Pulling Out MySQL Port? Hackerdragons PHP 6 11-24-03 05:30 AM


All times are GMT -5. The time now is 06:38 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.