Jump to content


Photo

Database ERROR!!!! Some One HELP!


  • Please log in to reply
2 replies to this topic

#1 Chirantha

Chirantha
  • Members
  • PipPip
  • Member
  • 17 posts

Posted 30 December 2005 - 05:32 AM

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

#2 LazyJones

LazyJones
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 30 December 2005 - 05:54 AM

Could you tell HOW it's not working? what is the error?


#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 30 December 2005 - 09:31 PM

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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users