Jump to content

Database ERROR!!!! Some One HELP!


Chirantha

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

Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.