Jump to content


Photo

Error on update to field of data type TEXT


  • Please log in to reply
2 replies to this topic

#1 eight17

eight17
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 17 August 2003 - 10:13 PM

I am creating a shopping cart with PHP/MySQL and have a table structured thus:
CREATE TABLE products (  ID int(4) unsigned NOT NULL auto_increment,  catID int(4) NOT NULL default \'0\',  catID2 int(4) default \'0\',  status int(2) NOT NULL default \'0\',  title varchar(250) NOT NULL default \'\',  desc text,  price float default NULL,  PRIMARY KEY  (ID)) TYPE=MyISAM;
I can do a SQL update to every field in this table except \'desc\' and that one throws an error. Does anyone know what could cause this? Even a query as simple as \"UPDATE products SET desc=\'duh\' WHERE ID = 123\" calls me a loser!

Please help!

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 17 August 2003 - 11:45 PM

DESC is a keyword in sql. if i remember correctly: try placing backquotes around it. if possible, rename that field.
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 eight17

eight17
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 18 August 2003 - 11:54 PM

:oops: Thanks for the tip. Other sources confirm that \"desc\" is indeed a reserved word. I guess I\'ll have to change my table. Good thing there\'s not much code relying on it yet...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users