I had the following code which worked on a previous version of mysql. Now on my new server, with the latest mysql release it doesn't work.
if ( $_POST['edit_news'] ) {
$sql = "UPDATE news SET news_date = '" . $_POST['news_date'] . "', news_author = '" . $_POST['news_author'] . "', news_photo_main = '" . $_POST['news_photo_main'] . "', news_photo_sub = '" . $_POST['news_photo_sub'] . "', news_category = '" . $_POST['news_category'] . "', news_intro = '" . $_POST['news_intro'] . "', news_story = '" . $_POST['news_story'] . "', news_headline = '" . $_POST['news_headline'] . "', instory_photo = '" . $_POST['instory_photo'] . "', instory_image = '" . $_POST['instory_image'] . "', instory_caption = '" . $_POST['instory_caption'] . "' WHERE newsID=" . $_GET['newsID'] . "";
$add_rating_rs = $conn->Execute($sql) or die ( $conn->ErrorMsg() );
header ( "Location: http://www.xxxx.com/xx/index.php" );
exit;
}
I get this error:
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 '' at line 1