Guys I am having a problem on how can I display array of records using mysql_num_rows, I cant use mysql_fetch_array because the format like this
$row['MR_no'];
that encloses the name of the field inside brackets in my SQL codes this is my codes:
<?php
$username = $_SESSION['username'];
$query = "select * from tblpatient_info i, tbllab_bloodchem b, tbldoctor_info d, tblpatient_pass p where p.RelationMR_no = i.MR_no and i.MR_no = b.RelationMR_no and b.RelationDoc_ID = d.ID_no and p.username = '$username'";
$result = mysql_query($query) or die(mysql_error());
$record = mysql_num_rows($result);
if ($record!=0)
{
while ($row = mysql_fetch_row($result))
{
//print_r($row);
$pName = $row[2]." ".$row[3]." ".$row[1];
$dName = $row[47]." ".$row[48]." ".$row[46];
$date = $row[14];
$RBS = $row[15];
$glucose = $row[16];
$bun = $row[17];
$creatinine = $row[18];
$Bua = $row[19];
$cholesterol = $row[20];
$triglyceride = $row[21];
$HDL = $row[22];
$LDL = $row[23];
$VLDL = $row[24];
$OGT = $row[25];
$GCT = $row[26];
$calcium = $row[27];
$others = $row[28];
$totalpro = $row[29];
$albumin = $row[30];
$globulin = $row[31];
$agratio = $row[32];
$sodium = $row[33];
$potassium = $row[34];
$chloride = $row[35];
$tbilirubin = $row[36];
$dbilirubin = $row[37];
$ibilirubin = $row[38];
$sgot = $row[39];
$sgpt = $row[40];
$ap = $row[41];
$mt = $row[42];
$pathologist = $row[43];
$time = $row[44];
<table cellpadding="2px" cellspacing="4px">
<tr>
<td width="400px"><b>Name: </b><?php echo $pName; ?></td>
<td><b>Date and Time: </b></td><td><?php echo $date." ".$time; ?></td>
</tr>
<tr>
<td colspan="3"><b>Doctor: </b><?php echo $dName; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Random Blood Sugar: </b><?php echo $RBS; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Glucose: </b><?php echo $glucose; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Bun: </b><?php echo $bun; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Creatinine: </b><?php echo $creatinine; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Bua: </b><?php echo $Bua; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Total Cholesterol: </b><?php echo $cholesterol; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Triglyceride: </b><?php echo $triglyceride; ?> </td>
</tr>
<tr>
<td colspan="3"><b>HDL: </b><?php echo $HDL; ?> </td>
</tr>
<tr>
<td colspan="3"><b>LDL: </b><?php echo $LDL; ?> </td>
</tr>
<tr>
<td colspan="3"><b>VLDL: </b><?php echo $VLDL; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Oral Glucose Tolerance: </b><?php echo $OGT; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Glucose Challenge Test: </b><?php echo $GCT; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Calciums: </b><?php echo $calcium; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Others: </b><?php echo $others; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Total Protein: </b><?php echo $totalpro; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Albumin: </b><?php echo $albumin; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Globulin: </b><?php echo $globulin; ?> </td>
</tr>
<tr>
<td colspan="3"><b>A/G Ratio: </b><?php echo $agratio; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Sodium: </b><?php echo $sodium; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Potassium: </b><?php echo $potassium; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Chloride: </b><?php echo $chloride; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Total Bilirubin: </b><?php echo $tbilirubin; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Direct Bilirubin: </b><?php echo $dbilirubin; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Indirect Bilirubin: </b><?php echo $ibilirubin; ?> </td>
</tr>
<tr>
<td colspan="3"><b>SGOT: </b><?php echo $sgot; ?> </td>
</tr>
<tr>
<td colspan="3"><b>SGPT: </b><?php echo $sgpt; ?> </td>
</tr>
<tr>
<td colspan="3"><b>ALK PHOS: </b><?php echo $ap; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Medical Technician: </b><?php echo $mt; ?> </td>
</tr>
<tr>
<td colspan="3"><b>Pathologist: </b><?php echo $pathologist; ?></td>
</tr>
</table>
}
}
else
{
die(mysql_error());
}
mysql_close();
?>