Does anyone have any idea where i am going wrong here? I have a quiz on a html page and i want the answers to be submitted into a table. My html page is fine but i am going wrong somewhere in my php page as shown below. Please can someone help?
[php]<?php
$id = $_GET[‘patid’];
$name = $_GET[‘name’];
$app = $_GET[‘appointment’];
$ward = $_GET[‘ward’];
if (isset($_GET[‘xray’])) {
$xray = $_GET[‘xray’];
} else {
$xray = “No”;
}
print “Name:”.$name."
";
print “Appointment:”.$app."
";
print “Ward:”.$ward."
";
print “X-Ray:”.$xray."
";
print “MRI:”.$mri."
";
print “CSCAN:”.$cscan."
";
print “EYE:”.$eye."
";
print “HEARING:”.$hearing."
";
$link = mysql_connect(‘localhost’,‘student’,‘student’) or die(mysql_error());
mysql_select_db(‘hospital’,$link);
$querydate = “SELECT CURDATE() as Today”;
$result1 = mysql_query($querydate,$link) or die(mysql_error());
$row = mysql_fetch_assoc($result1);
$today = $row[‘Today’];
$query = “INSERT INTO discharge VALUES (NULL,’$name’,’$app’,’$ward’,’$xray’,’$mri’,’$cscan’,’$eye’,’$hearing’,’$today’)”;
$result = mysql_query($query,$link) or die(mysql_error());
$affected = mysql_affected_rows($link);
if ($affected >0) {echo “success”;} else {echo “fail”;}
$query3 = “SELECT * FROM discharge”;
$result3 = mysql_query($query3,$link) or die(mysql_error());
$row3 = mysql_fetch_assoc($result3);
?>