FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


SQL error





wietn
I gett this error when I'm trying to install my toplist script.

Code:
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 'out int(11) NOT NULL default '0',
  out_past int(11) NOT NULL default '0',
  hit' at line 1

Query: CREATE TABLE mtl_sites (
  id int(11) NOT NULL auto_increment,
  owner int(11) NOT NULL default '0',
  owner_accept tinyint(2) NOT NULL default '0',
  date varchar(50) NOT NULL default '',
  a_admin tinyint(4) NOT NULL default '0',
  a_ban tinyint(4) NOT NULL default '0',
  a_hide tinyint(4) NOT NULL default '0',
  cat int(11) NOT NULL default '0',
  site_name varchar(250) NOT NULL default '',
  site_desc varchar(250) NOT NULL default '',
  site_url varchar(250) NOT NULL default '',
  site_banner varchar(250) NOT NULL default '',
  site_moment tinyint(4) NOT NULL default '0',
  in_webring tinyint(2) NOT NULL default '0',
  notepad text NOT NULL,
  notepad_size int(11) NOT NULL default '0',
  comments int(11) NOT NULL default '0',
  votes int(11) NOT NULL default '0',
  votes_past int(11) NOT NULL default '0',
  out int(11) NOT NULL default '0',
  out_past int(11) NOT NULL default '0',
  hits int(11) NOT NULL default '0',
  hits_past int(11) NOT NULL default '0',
  rating_total int(11) NOT NULL default '0',
  rating int(11) NOT NULL default '0',
  rating_past int(11) NOT NULL default '0',
  KEY id (id)
) TYPE=MyISAM


I think it's the auto_increment 'thing', but I'm not sure...
Searched at google, but I understand nothing of what they're saying...

Ohyea, I'm on server1.
PHP version: 5.2.4
MySQL version: 5.0.27-standard
MrBlueSky
out is a reserved word since Mysql version 5.0, so you are not supposed to use it as a fieldname. So this:

Code:

out int(11) NOT NULL default '0',


probably causes the error. Try using another name for this field, and see if that solves it.
wietn
Thx MrBleuSky

Just like you said, out is a reserved word Smile

I putted out (and the rest...) between '`' and now it works Wink

Thx
Related topics
Help: SQL error after uploading new files(thread updated)
Forum error when posting
Error Posting...
Frihost Forum Error (30/08/2005)
Sql Error: 1017. Missing all the indexes files of phpbb
SQL error notification in my forum
SQL error
SQL error on my site
[man] SQL Error : 1054 Unknown column \'session_admin\ en DB
SQL error
SQL ERROR [ mysql4 ] - due to hosting? -
[SQL] Error in SQL Code
Strange SQL error
SQL ERROR [ mysqli ]
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.