include("databaseconnection.php");?>
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
?>
//Page
if(isset($_GET['page']))
{
$page=$_GET['page'];
}
else
{
$page=0;
}
?>
//GET city
if(isset($_GET['city']))
$city=$_GET['city'];
else
$city="";
if(isset($_COOKIE['city']))
{
$city=$_COOKIE['city'];
}
?>
The Doctor Appointment System
if(isset($_GET['q'])){
$offset=$page*10;
$q=$_GET['q'];
$sql="SELECT * from doctor where name LIKE '%$q%' OR speciality LIKE '%$q%' OR city='$city' LIMIT 10 OFFSET $offset";
$result=$conn->query($sql);
if ($result->num_rows > 0) {
while($row=$result->fetch_assoc()) {
$id=$row['id'];
$name=$row['name'];
$profile=$row['profile'];
$address=$row['address'];
echo '
';
echo "
$name
Address : $address";
echo '';
}
}else{
echo "
No Result
";
}
}
?>