My code is below. I am using infinityfree host. This is what I get an 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 1
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Delete Record Form</title>
</head>
<body style="background-color:powderblue;">
<form action="deletePatientInfo.php" method="post">
<p>
<label for="PatientNumber">Patient Number:</label>
<input type="text" name="PatientNumber" id="patientNumber">
</p>
<hr>
<input type="submit" value="Delete" id = "delete" >
</form>
<form action="http://thecraaz.epizy.com/Sharara_Hospital.php">
<input type="submit" value="Go to HomePage" />
</form>
<p style="font-family:verdana"> STAY HEALTHY STAY YOUNG </p>
</body>
</html>
The following is my PHP portion. Please help me. It is for a project.
<?php
$con = mysql_connect("sql212.epizy.com","***********","*********");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("epiz_27319584_doctor_patient", $con);
$PatientNumber = $_POST['PatientNumber'];
$sql = "DELETE FROM Patient_File WHERE PatientNumber = $PatientNumber" ;
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
else
{
echo "1 record deleted successfully";
}
mysql_close($con)
?>