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 | | +----------+--------------+------+-----+----------+----------------+ Link to comment https://forums.phpfreaks.com/topic/119174-solved-update-trouble/ Share on other sites More sharing options...
revraz Posted August 11, 2008 Share Posted August 11, 2008 What is the mysql error? Link to comment https://forums.phpfreaks.com/topic/119174-solved-update-trouble/#findComment-613747 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. Link to comment https://forums.phpfreaks.com/topic/119174-solved-update-trouble/#findComment-613754 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. Link to comment https://forums.phpfreaks.com/topic/119174-solved-update-trouble/#findComment-613824 Share on other sites More sharing options...
unkwntech Posted August 11, 2008 Author Share Posted August 11, 2008 WOW,..... thx Link to comment https://forums.phpfreaks.com/topic/119174-solved-update-trouble/#findComment-613951 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.