Hey, I’m having a bit of trouble with this code…
[code]<?php
#view_appointment.php
session_start();
if($_SESSION[‘access_level’] == 1)
{
#require_once(’./connections/connect.php’);
#require_once(’./templates/header.php’);
$query = “SELECT * FROM appointment”;
$result = mysql_query($query);
echo ‘
’;echo “”;
echo “
Appointment ID | Appointment Date | Patient ID | Diagnosis | Fee | ”; |
---|
}
?>
Select an option to refine your search
View Appointment By:
Appointment ID Appointment Date Diagnosis FeeEnter Appointment ID :
<input type = "submit" name = "search" id = "search" value = "Go" <?php if (isset($_POST['submit'])) { $view = $_POST['view']; switch($view) { case 'a_id': $query = "SELECT a_id, a_date, diagnosis, fee, p_id FROM appointment ORDER BY a_id"; $result = mysql_query($query) or die(mysql_error()); $num_results = mysql_num_rows($result); echo 'Number of records found: '.$num_results.'
'; echo 'Appointment ID | Appointment Date | Patient ID | Diagnosis | Fee | '; while ($row = mysql_fetch_array($result)) { echo '
---|---|---|---|---|
'.$row['a_id'].' | ';
echo ''.$row['a_date'].' | ';
echo ''.$row['p_id'].' | ;
echo ''.$row['diagnosis'].' | ;
echo ''.$row['fee'].' | ;
echo '
Number of records found: '.$num_results.'
'; echo 'Appointment ID | Appointment Date | Patient ID | Diagnosis | Fee | '; while ($row = mysql_fetch_array($result)) { echo '
---|---|---|---|---|
'.$row['a_id'].' | ';
echo ''.$row['a_date'].' | ';
echo ''.$row['p_id'].' | ;
echo ''.$row['diagnosis'].' | ;
echo ''.$row['fee'].' | ;
echo '
Number of records found: '.$num_results.'
'; echo 'Appointment ID | Appointment Date | Patient ID | Diagnosis | Fee | '; while ($row = mysql_fetch_array($result)) { echo '
---|---|---|---|---|
'.$row['a_id'].' | ';
echo ''.$row['a_date'].' | ';
echo ''.$row['p_id'].' | ;
echo ''.$row['diagnosis'].' | ;
echo ''.$row['fee'].' | ;
echo '
Number of records found: '.$num_results.'
'; echo 'Appointment ID | Appointment Date | Patient ID | Diagnosis | Fee | '; while ($row = mysql_fetch_array($result)) { echo '
---|---|---|---|---|
'.$row['a_id'].' | ';
echo ''.$row['a_date'].' | ';
echo ''.$row['p_id'].' | ;
echo ''.$row['diagnosis'].' | ;
echo ''.$row['fee'].' | ;
echo '
Number of records found: '.$num_results.'
'; echo 'Appointment ID | Appointment Date | Patient ID | Diagnosis | Fee | '; while ($row = mysql_fetch_array($result)) { echo '
---|---|---|---|---|
'.$row['a_id'].' | ';
echo ''.$row['a_date'].' | ';
echo ''.$row['p_id'].' | ;
echo ''.$row['diagnosis'].' | ;
echo ''.$row['fee'].' | ;
echo '
Number of records found: '.$num_results.'
'; echo 'Appointment ID | Appointment Date | Patient ID | Diagnosis | Fee | '; while ($row = mysql_fetch_array($result)) { echo '
---|---|---|---|---|
'.$row['a_id'].' | ';
echo ''.$row['a_date'].' | ';
echo ''.$row['p_id'].' | ;
echo ''.$row['diagnosis'].' | ;
echo ''.$row['fee'].' | ;
echo '
[/code]
When I try to run it, I receive the following error:
Parse error: parse error, unexpected T_VARIABLE in c:webstestview_appointment.php on line 24
Thanks, Any help appreciated!!!