Heres the codecould not insertYou have an error in your SQL syntax near '1'' at line 1
Code: Select all
if(isset($_GET['person_id'])){
$person_id=$_GET['person_id'];
}
if ($_POST['Submit'] == 'Save'){
foreach ($_POST as $formName => $phpName){
$$formName = $phpName;
}
$sql ="UPDATE feedbackcontacts SET "
. " salutation='" .$salutation."',"
. " name='" .$name."',"
. " surname='" .$surname."',"
. " organisation='" .$organisation."',"
. " email='" .$email."',"
. " address='" .$address ."',"
. " address1='" .$address1 ."',"
. " telephonefax='" .$telephonefax."',"
. " mobile='" . $mobile."',"
. " mscints='" .$mscints."',"
. " mscactive='" .$mscactive."',"
. " otheractivities='" .$otheractivities."',"
. " gradjobs='" .$gradjobs."',"
. " ugproj='" . $ugproj ."',"
. " pdev='" .$pdev."',"
. " bcsmem='" .$bcsmem."',"
. " bcspds='" .$bcspds."',"
. " teach='" .$teach."',"
. " acconsult='" .$acconsult.","
. " WHERE person_id='" . $person_id."'";Code: Select all
echo "<br><div align=center><br>";
mysql_query($sql) or die('could not insert' . mysql_error());
echo " <div align=left><table width=70% border=1 cellpadding=10 align=center>"
. " <tr>"
. " <td width=40%>"
. " <font face=arial size=2><b>"
. " Salutation"
. " </font>"
. " </td>"
. " <td>"
. " <font face=arial size=2>"
. " " . $salutation . "</font>"
. " </td>"
. " </tr>"
This continues for all the other table fields....................Code: Select all
$sql = "SELECT * FROM feedbackcontacts WHERE person_id='" . $person_id . "'";