Forum Moderators: coopster
CREATE TABLE `info` (
`id` int(11) AUTO_INCREMENT,
`care_provider` varchar(255),
`patient_name` varchar(255),
`date_of_service` date(10), //for the week part
`time_in` time(10),
`time_out` time(10),
`remarks` varchar(255),
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("prive_ts", $con);
$sql = "SELECT * FROM info";
if (isset($_POST['search_box']) && $_POST['search_box']) {
$search_term = mysql_real_escape_string($_POST['search_box']);
$sql .= " WHERE patient_name = '{$search_term}' ";
}
$query = mysql_query($sql) or die(mysql_error());
?>
<form name="search_form" method="POST" action="results38.php">
Search: <input type="text" name="search_box" value="" />
<input type="week" name="week" value="" />
<input type="submit" name="search" value="Look up Patient ...">
</form>
<table width="70%" cellpadding="5" cellspace="5">
<tr>
<td><strong>Care Provider</strong></td>
<td><strong>Patient Name</strong></td>
<td><strong>Date of Time</strong></td>
<td><strong>Time In</strong></td>
<td><strong>Time Out</strong></td>
<td><strong>Remarks</strong></td>
</tr>
<?php while ($row = mysql_fetch_array($query)) { ?>
<tr>
<td><?php echo $row['care_provider']; ?></td>
<td><?php echo $row['patient_name']; ?></td>
<td><?php echo $row['date_of_service']; ?></td>
<td><?php echo $row['time_in']; ?></td>
<td><?php echo $row['time_out']; ?></td>
<td><?php echo $row['remarks']; ?></td>
</tr>
<?php } ?>
</table>