Jump to content

Archived

This topic is now archived and is closed to further replies.

Chirantha

Database ERROR!!!! Some One HELP!

Recommended Posts

Hi,

 

I'm trying to restore my SMF DB but its not wroking. It because this part has an error\

 

 DROP TABLE IF EXISTS smf_shop_items;
CREATE TABLE smf_shop_items (
  id int(10) unsigned NOT NULL auto_increment,
  name varchar(50) NOT NULL default '',
  desc varchar(100) NOT NULL default '',
  price decimal(8,2) unsigned NOT NULL default '0.00',
  module tinytext NOT NULL,
  stock smallint(6) NOT NULL default '0',
  info1 text NOT NULL,
  info2 text NOT NULL,
  info3 text NOT NULL,
  info4 text NOT NULL,
  input_needed tinyint(3) unsigned NOT NULL default '1',
  can_use_item tinyint(3) unsigned NOT NULL default '1',
  image tinytext NOT NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;

--
-- Dumping data for table `smf_shop_items`
--

INSERT INTO smf_shop_items (id, name, desc, price, module, stock, info1, info2, info3, info4, input_needed, can_use_item, image) VALUES (21,'Buy a ticket to upload a 65MB file','You can buy a ticket to upload a 65MB file for just 50 points','50.00','buyupgrade',44,'','','','',1,1,'Filefolder.gif');
INSERT INTO smf_shop_items (id, name, desc, price, module, stock, info1, info2, info3, info4, input_needed, can_use_item, image) VALUES (17,'Remove User Title','Remove your user title','5.00','RemoveUserTitle',99,'','','','',0,1,'Icecream.gif');
INSERT INTO smf_shop_items (id, name, desc, price, module, stock, info1, info2, info3, info4, input_needed, can_use_item, image) VALUES (18,'Increase Total Time by 2 hours','Increase your total time logged in by 2 hours','80.00','IncreaseTimeLoggedIn',50,'7200','','','',0,1,'IronDevil.gif');
INSERT INTO smf_shop_items (id, name, desc, price, module, stock, info1, info2, info3, info4, input_needed, can_use_item, image) VALUES (14,'Change User Title','Change your user title for 40 points','40.00','ChangeUserTitle',47,'','','','',1,1,'Wheel.gif');

Can some one please tell me what is wrong with it. Please HELP. Thank you,Chirantha

Share this post


Link to post
Share on other sites

The error is that you're using a reserved keyword -- "desc" -- as one of your column names. You should really change this to "description", but in the meanwhile, you'll have to add backticks (`desc`) both to your CREATE TABLE and your INSERT statements, otherwise the SQL parser will be very unhappy. Be careful in the future -- there are so many words, that there's no need to run into keyword conflicts.

 

Hope that helps.

Share this post


Link to post
Share on other sites

×

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.