I am trying to delete a particular id from a table in PHP. I have written two queries in the same php.
something like this:
<?php
include("db.php");
$response = array();
if (isset($_POST['userID']))
{
$userID = $_POST['userID'];
$result1 = mysql_query("DELETE FROM profile WHERE userID = '$userID'");
$result2 = mysql_query("DELETE FROM profile_details WHERE userID = '$userID'");
if ($result1 && $result2 )
{
$response["success"] = 1;
$response["message"] = "row successfully created.";
echo json_encode($response);
}
else
{
$response["success"] = 0;
$response["message"] = "Oops! An error occurred.";
echo json_encode($response);
}
}
else
{
$response["success"] = 0;
$response["message"] = "Required field(s) is missing";
echo json_encode($response);
}
?>
I get the following error:
Parse error: syntax error, unexpected '$result1' (T_VARIABLE) in /homepages/htdocs/radiansa.com/extras/a/test2.php on line 16
I am not sure what could be wrong here..