<?php
$q=$_GET['q'];
$my_data=mysql_real_escape_string($q);
include('dbconnect.php');
$sql="SELECT * FROM doctordetails WHERE doctorname LIKE '%$my_data%' or location LIKE '%$my_data%'";
$result = mysql_query($sql) or die(mysql_error());
if($result)
{
while($row=mysql_fetch_array($result))
{
echo $row['doctorname']."\n";
echo $row['location']."\n";
}
}
$sql="SELECT * FROM doctspecialist WHERE type LIKE '%$my_data%'";
$res= mysql_query($sql) or die(mysql_error());
if($res)
{
while($row=mysql_fetch_array($res))
{
echo $row['type']."\n";
}
}
$sql="SELECT * FROM doctsymptom WHERE type LIKE '%$my_data%'";
$resl= mysql_query($sql) or die(mysql_error());
if($resl)
{
while($row=mysql_fetch_array($resl))
{
echo $row['type']."\n";
}
}
?>