Please help me. I keep getting this coding error...
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 10
Here is the code from my actionfrm.php file:
<?php include('dbconnect.php'); ?>
<?php
$membername=$POST['membername'];
if(isset($POST['username']) and $POST['username']!=""){
$sponsorid=$SESSION['memberid_for_sp'];
}else{
$sponsorid=0;
}
$dateofjoining=date("Y-m-d");;
$address=$POST['address'];
$city=$POST['city'];
$state=$POST['state'];
$country=$POST['country'];
$mobileno=$POST['mobileno'];
$countrycode=$POST['countrycode'];
$dateofbirth=$POST['dateofbirth'];
$emailid=$POST['emailid'];
$myid=$_SESSION['memberid'];
$sql="UPDATE personal SET membername='$membername',
sponsorid='$sponsorid',
dateofjoining='$dateofjoining',
address='$address',
city='$city',
state='$state',
country='$country',
mobileno='$mobileno',
countrycode='$countrycode',
dateofbirth='$dateofbirth', emailid='$emailid' WHERE memberid=$myid";
if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
header('Location: coapp.php?msg=1');
//return $frmdetail.php;
?>
PLEASE, PLEASE HELP ME! I really want to get this resolved. I'm a newbie to php programming.
Eric