<table width="700" border="1" bordercolor="#FFFFFF" bgcolor="#000000">
<tr bgcolor="#FFFF66">
<td height="28" colspan="3" align="center"><strong> My Blood Pressure Data</strong></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Date:</td>
<td>:</td>
<td><?php echo $row["date"];?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td width="170">Select a time(12Hours)</td>
<td width="3">:</td>
<td><?php echo $row["time"]; ?></td>
</tr>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFFF">
<td>Systolic mm Hg</td>
<td>:</td>
<td><?php echo $row["systolic"]; ?>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Diastolic mm Hg</td>
<td>:</td>
<td><?php echo $row["diastolic"]; ?>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Pulse</td>
<td>:</td>
<td><?php echo $row["pulse"]; ?></td>
</tr>
<?php
$systolic= "systolic";
$diastolic= "diastolic";
$select=@mysql_query("SELECT systolic, diastolic FROM blood_record");
$info=@mysql_fetch_array($select, $conn);
if($info)
{
if($systolic < 120 AND $diastolic < 80)
{
$level = "NORMAL";
}
else if($systolic >120 && $systolic <139 AND $diastolic >80 && $diastolic <89)
{
$level = "AT RISK";
}
else if($systolic >140 AND $diastolic >90)
{
$level = "HIGH";
}
else
{
$level = "nothing";
}
}
?>
<tr bgcolor="#FFFFFF">
<td>Blood Pressure Level</td>
<td>:</td>
<td><?php echo $level; ?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>Patient's Name</td>
<td>:</td>
<td><?php echo $row["name"]; ?></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="28">Comment</td>
<td>:</td>
<td><?php echo $row["comment"]; ?>
</td>
</tr>
</table>
so basically my error has something to do with the php code. error displayed is undefined index for <?php echo $level?> id like to know what i did wrong and/or improvement in my php code especially the else if statements. thanks in advance.