What is wrong with this MySQL statement?
$my->query("UPDATE ideas
SET category = 'Document Options',
category_id = '4',
status = 'Released',
status_id = '3',
title = 'Support for iPad',
idea = 'Add support for iPad. Allow uploads and downloads via the anonymous App for iPhone and iPad.',
release = 开发者_Python百科'0',
release_date = ''
WHERE id = '225'");
$my
is a custom class which contains a lot of other mysql commands. To prove it works fine it works great for the following query:
$my->query("UPDATE idea_feedback
SET Feedback = '$feedback',
Date = '$fdate'
WHERE ID = '$i'");
Release is a keyword, backtick it
$my->query("UPDATE ideas SET category='Document Options', category_id='4',
status='Released', status_id='3', title='Support for iPad',
idea='Add support for iPad. Allow uploads and downloads via the anonymous App for iPhone and iPad.',
`release`='0', release_date='' WHERE id='225'");
Notes:
- release_date='' set it to the invalid date marker '0000-00-00'
- please don't quote numbers, even if MySQL allows you to
精彩评论