Jump to content

syntax error


BigD
 Share

Recommended Posts

The following code has syntax error, parse error on last line. If you have sharp eyes, please take a look:error is - unexpected $end <?php include("../mylibrary/login.php"); login(); echo "<table width=\"100%\" cellpadding=\"1\" border=\"1\">\n"; echo "<tr><td><b>Last Name</b></td><td><b>First Name</b></td><td><b>Attending Status</b></td></tr>\n"; $classname = $_REQUEST['classname']; $ldate = $_REQUEST['ldate']; $cname = $_REQUEST['cname']; $chour = $_REQUEST['chour']; $query = "SELECT classid "; $query .= " from class "; $query .= " where classname = '$classname'"; $result = mysql_query($query); if (!$result) echo "<h2>SQL error</h2>\n". mysql_error(); $row = mysql_fetch_array($result, MYSQL_ASSOC); $classid = $row['classid']; $query = "SELECT lastname, firstname "; $query .= " FROM student"; $query .= " where classid = $classid"; $query .= " order by lastname"; $result = mysql_query($query); if (!$result) echo "<h2>SQL error</h2>\n". mysql_error(); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $lastname = $row['lastname']; $firstname = $row['firstname']; echo "<tr><td>$lastname</td><td>$firstname</td>"; $absent_status = 'unchecked'; $partiallyThere_status = 'unchecked'; $present_status = 'checked'; if (isset($_POST['phour'])) { $selected_radio = $_POST['gender']; if ($selected_radio == 'absent') { $absent_status = 'checked'; } else if ($selected_radio == 'partiallyThere') { $partiallyThere_status = 'checked'; } else if ($selected_radio == 'present') { $present_status = 'checked'; } echo "<td><input type=\"radio\" name=\"group1\" value=\"1\" checked> Present</td>"; echo "<td><input type=\"radio\" name=\"group1\" value=\"Absent\" > Absent</td>"; echo "<td><input type=\"radio\" name=\"group1\" value=\"PartialPresent\"> Partially there</td>"; echo "<td><input type=\"text\" name=\"phour\" size=\"4\"></td>"; } echo "</table>\n";?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...