$result1 = mysql_query("Select * from tbl_lastLocation where driver_id='$user_id');
if(mysql_num_rows($result1)){
$result2 = mysql_query("UPDATE tbl_lastLocation SET Latitude='$Latitude',Longtitude='$Longitude',vehicle_id='$vehicle_id',data_create='$date_create',time_create='$time_create' WHERE driver_id='$user_id'"); //line 17
}
else{
$result2 = mysql_query("INSERT INTO tbl_lastLocation (driver_id,vehicle_id,Latitude,Longtitude,data_create,time_create) VALUES ('$user_id','$vehicle_id','$Latitude','$Longitude','$date_create','$time_create')");
}
$data["result"] = "1";
echo json_encode($data);
?>
I am getting an error:
PHP Parse error: syntax error, unexpected 'UPDATE' (T_STRING) in /home/barbodpl/public_html/its_api/lastlocation.php on line 17
What does the error mean and how do I fix it?