Can anybody see what the error is here please?
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 'WHERE id = 3' at line 1 UPDATE instructors SET course1 = 'Scottish Research Online', course2 = 'Scotland 1750 - 1850: Beyond the OPRs', course3 = 'England & Wales Online – Bring Your Knowledge to the Web', course4 = 'Ireland: A Practical Approach to Family History', course5 = 'Researching Irish Ancestors Before 1820', course6 = 'One to One Tutorial', course7 = '', course8 = '', mainimage = ' homepageimage = '', publication1link = '', publication2link = '', publication3link = '', publication4link = '', publication1image = '', publication2image = '', publication3image = '', publication4image = '', publicationsfooter = 'Buy Sherry\'s Books Now - simply click on the book to be taken to the Ancestry Store.', WHERE id = 3 Instructor Details Modified
and this is the code in the page I'm using to try and update the database:
if ($REQUEST_METHOD == "POST") {
$SQL = " UPDATE instructors SET ";
$SQL = $SQL . " course1 = '$course1', ";
$SQL = $SQL . " course2 = '$course2', ";
$SQL = $SQL . " course3 = '$course3', ";
$SQL = $SQL . " course4 = '$course4', ";
$SQL = $SQL . " course5 = '$course5', ";
$SQL = $SQL . " course6 = '$course6', ";
$SQL = $SQL . " course7 = '$course7', ";
$SQL = $SQL . " course8 = '$course8', ";
$SQL = $SQL . " mainimage = '$mainimage', ";
$SQL = $SQL . " homepageimage = '$homepageimage', ";
$SQL = $SQL . " publication1link = '$publication1link', ";
$SQL = $SQL . " publication2link = '$publication2link', ";
$SQL = $SQL . " publication3link = '$publication3link', ";
$SQL = $SQL . " publication4link = '$publication4link', ";
$SQL = $SQL . " publication1image = '$publication1image', ";
$SQL = $SQL . " publication2image = '$publication2image', ";
$SQL = $SQL . " publication3image = '$publication3image', ";
$SQL = $SQL . " publication4image = '$publication4image', ";
$SQL = $SQL . " publicationsfooter = '$publicationsfooter', ";
$SQL = $SQL . " WHERE id = $id";
$result = mysql_db_query($db,"$SQL",$cid);
if (!$result) {
echo("ERROR: " . mysql_error() . "\n$SQL\n"); }
echo ("Instructor Details Modified\n");
}
driving me nuts.....
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 'WHERE id = 3' at line 1 UPDATE instructors SET course1 = 'Scottish Research Online', course2 = 'Scotland 1750 - 1850: Beyond the OPRs', course3 = 'England & Wales Online – Bring Your Knowledge to the Web', course4 = 'Ireland: A Practical Approach to Family History', course5 = 'Researching Irish Ancestors Before 1820', course6 = 'One to One Tutorial', course7 = '', course8 = '', mainimage = ' homepageimage = '', publication1link = '', publication2link = '', publication3link = '', publication4link = '', publication1image = '', publication2image = '', publication3image = '', publication4image = '', publicationsfooter = 'Buy Sherry\'s Books Now - simply click on the book to be taken to the Ancestry Store.', WHERE id = 3 Instructor Details Modified
and this is the code in the page I'm using to try and update the database:
if ($REQUEST_METHOD == "POST") {
$SQL = " UPDATE instructors SET ";
$SQL = $SQL . " course1 = '$course1', ";
$SQL = $SQL . " course2 = '$course2', ";
$SQL = $SQL . " course3 = '$course3', ";
$SQL = $SQL . " course4 = '$course4', ";
$SQL = $SQL . " course5 = '$course5', ";
$SQL = $SQL . " course6 = '$course6', ";
$SQL = $SQL . " course7 = '$course7', ";
$SQL = $SQL . " course8 = '$course8', ";
$SQL = $SQL . " mainimage = '$mainimage', ";
$SQL = $SQL . " homepageimage = '$homepageimage', ";
$SQL = $SQL . " publication1link = '$publication1link', ";
$SQL = $SQL . " publication2link = '$publication2link', ";
$SQL = $SQL . " publication3link = '$publication3link', ";
$SQL = $SQL . " publication4link = '$publication4link', ";
$SQL = $SQL . " publication1image = '$publication1image', ";
$SQL = $SQL . " publication2image = '$publication2image', ";
$SQL = $SQL . " publication3image = '$publication3image', ";
$SQL = $SQL . " publication4image = '$publication4image', ";
$SQL = $SQL . " publicationsfooter = '$publicationsfooter', ";
$SQL = $SQL . " WHERE id = $id";
$result = mysql_db_query($db,"$SQL",$cid);
if (!$result) {
echo("ERROR: " . mysql_error() . "\n$SQL\n"); }
echo ("Instructor Details Modified\n");
}
driving me nuts.....