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


[SQL] Error in SQL Code





silverdown
I can't find the error in this code, for some odd reason it has one. Does frihost hosting forbid some SQL commands?

Code:
CREATE TABLE IF NOT EXISTS `phpbb_medals_awarded` (
  `id` int(10) NOT NULL auto_increment,
  `medal_id` bigint(20) NOT NULL default '0',
  `user_id` bigint(20) NOT NULL default '0',
  `awarder_id` bigint(20) NOT NULL default '0',
  `awarder_un` varchar(255) collate utf8_bin NOT NULL default '',
  `awarder_color` varchar(6) collate utf8_bin NOT NULL default '',
  `time` int(11) NOT NULL default '0',
  `nominated` tinyint(1) NOT NULL default '0',
  `nominated_reason` text collate utf8_bin NOT NULL,
  `points` smallint(4) NOT NULL default '0',
  `bbuid` varchar(255) collate utf8_bin NOT NULL,
  `bitfield` varchar(255) collate utf8_bin NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `time` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;
rvec
what warning do you get?
silverdown
Code:

Error

SQL query:

CREATE TABLE IF NOT EXISTS `phpbb_medals_awarded` (
`id` int( 10 ) NOT NULL AUTO_INCREMENT ,
`medal_id` bigint( 20 ) NOT NULL default '0',
`user_id` bigint( 20 ) NOT NULL default '0',
`awarder_id` bigint( 20 ) NOT NULL default '0',
`awarder_un` varchar( 255 ) COLLATE utf8_bin NOT NULL default '',
`awarder_color` varchar( 6 ) COLLATE utf8_bin NOT NULL default '',
`time` int( 11 ) NOT NULL default '0',
`nominated` tinyint( 1 ) NOT NULL default '0',
`nominated_reason` text COLLATE utf8_bin NOT NULL ,
`points` smallint( 4 ) NOT NULL default '0',
`bbuid` varchar( 255 ) COLLATE utf8_bin NOT NULL ,
`bitfield` varchar( 255 ) COLLATE utf8_bin NOT NULL ,
PRIMARY KEY ( `id` ) ,
KEY `time` ( `time` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_bin AUTO_INCREMENT =1

MySQL said:
#1064 - 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 'collate utf8_bin NOT NULL default '',
  `awarder_color` varcha
ashok
You are specifying a NOT NULL field, and you aren't giving a default value in the quotes '', try inserting a space in those quotes... If it doesn't work, insert 0s just like u did with the fields above the field which is giving error...
Related topics
Help: SQL error after uploading new files(thread updated)
Strange SQL error
SQL ERROR [ mysqli ]
Sql Error: 1017. Missing all the indexes files of phpbb
SQL error notification in my forum
SQL error on my site
[man] SQL Error : 1054 Unknown column \'session_admin\ en DB
SQL ERROR [ mysql4 ] - due to hosting? -
after server 4 crash I have a 500 error code
memory issue error code 0123
SQL error
SQL error
Error writing to Temp SQL files
have problem on my sql
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

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