unkwntech Posted August 11, 2008 Share Posted August 11, 2008 This query is not working: UPDATE products SET name='Sesame Chicken Salad', desc='', price='12.99', status='active', shipping='0.00', section='american', text='BIG LONG STRING' WHERE id='4' The table looks like this: +----------+--------------+------+-----+----------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+--------------+------+-----+----------+----------------+ | id | int(25) | NO | PRI | NULL | auto_increment | | name | varchar(250) | NO | | | | | desc | text | NO | | NULL | | | price | decimal(9,2) | NO | | 0.00 | | | status | varchar(200) | YES | | inactive | | | shipping | decimal(5,2) | NO | | 0.00 | | | section | varchar(250) | YES | | NULL | | | text | text | NO | | NULL | | +----------+--------------+------+-----+----------+----------------+ Quote Link to comment Share on other sites More sharing options...
revraz Posted August 11, 2008 Share Posted August 11, 2008 What is the mysql error? Quote Link to comment Share on other sites More sharing options...
unkwntech Posted August 11, 2008 Author Share Posted August 11, 2008 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 'desc='', price='12.99', status='active', shipping='0.00', section='american', te' at line 1 SQL version is up to date as of yesterday Aug 10th. ID 4 does exits. Adding data to desc='' does not help. Quote Link to comment Share on other sites More sharing options...
revraz Posted August 11, 2008 Share Posted August 11, 2008 DESC is a mysql reserved word (meaning Decending for sorting). Change the fieldname and it should work fine. Quote Link to comment Share on other sites More sharing options...
unkwntech Posted August 11, 2008 Author Share Posted August 11, 2008 WOW,..... thx Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.