am writting my class work project assignment but am stuck can some one help me out,
am tring to pick data from patients table and diagnosistreatment tables which are mysql tables but the code is not working
<?php
//This code retrieves a particulat patients record from dianosis and treatment table
// Connects to your Database
require_once('Connections/Database.php');
mysql_select_db($database_Database, $Database);
//checks if a number was entered
if (!$_POST['pnum'] )
{
die('You did not complete all of the required fields');
}
$a=$_POST['pnum'];
$stat="SELECT * FROM diagnosistreatment ,patients WHERE pID='$a'";
if (isset($_POST['SUBMIT']))
{
$result1=mysql_query($stat);
$num=mysql_num_rows($result1);
if ($num<1)
{
exit("The Patient Number u have entered doesnt exist please make sure u entered the right Patient number.<br>");
}
else
echo"<table >";
while ($result=mysql_fetch_array($result1))
{
echo"<pre> Patients number :$result[pID] <br>
Patients Names :$result[pName] $result[pfName] <br>
Age :$result[age] <br>
Patients lives in :$result[village] <br>
Department Visited :$result[dept] <br>
Sex :$result[sex] <br>
Tribe :$result[tribe] <br>
Presented with :$result[symptoms] <br>
Date visited :$result[month] $result[day] $result[year]<br>
Patients Weight :$result[wgt] Kilograms<br>
Patients Height :$result[hgt] centimetres<br>
Temperature :$result[temp] Degrees centigrade<br>
Blood Pressure :$result[bldp]mmhg <br>
Doctors ID :$result[dID] <br>";
echo"<pre> Doctor's/Clinicians ID :$result[dID] <br>
Patients NO :$result[pID]<br>
Treatment NO :$result[treatmentnum]<br>
Final diagois :$result[finalDiagnosis] <br>
Treatment Given :$result[treatment] <br>
Date of Discharge :$result[month] $result[day] $result[year]<br>
Discharge Notes :$result[dischargenotes] <br>
Next Appointment :$result[monthapt] $result[dayapt] $result[yearapt]<br> ";
}
echo"</table>";
}
?>