Solution:
Html file :
<html>
<body>
<form action="slip_21.php" method="get">
Enter the Name Of Hospital : <input type=text name=hosp><br>
<input type=submit value=SUBMIT>
</form>
</body>
<html>
Php file :
<?php
$hosp=$_GET['hosp'];
$con=mysql_connect("localhost","root","");
$d=mysql_select_db("bca_programs",$con);
$q=mysql_query("select doctor.doc_no,doc_name,address,city,area from doctor,hospital,doc_hosp where hosp_name='$hosp' and doc_hosp.doc_no=doctor.doc_no and doc_hosp.hosp_no=hospital.hosp_no");
echo "<tr><td>Doctor no--</td><td>Doctor Name--</td><td>Address--</td><td>city--</td><td>Area</td></tr>";
while($row=mysql_fetch_array($q))
{
echo "<br><tr><td>".$row[0]." | </td><td>".$row[1]." | </td><td>".$row[2]." | </td><td>".$row[3]." |</td><td>".$row[4]." |</td></tr>";
}
mysql_close();
?>
0 Comments