Guest User

Untitled

a guest
Aug 20th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <?php
  2. $username="";
  3. $password="";
  4.  
  5. $conn = mysqli_connect('localhost', 'root', '', 'mydatabase');
  6.  
  7. if($conn->connect_error){
  8. die("Connection Failed:" . $conn->connect_error);
  9. }
  10.  
  11. $sql = "SELECT DoctorID, Images, DoctorName, gender, speciality FROM tb_doctor";
  12. $result =$conn->query($sql);
  13.  
  14. if ($result->num_rows >0){
  15. while($row = $result->fetch_assoc()){
  16. echo "<div class ='col-sm-4 text-center'>";
  17. echo "<img src='images/" .$row['Images']."'class='center-block'>";
  18. echo "<p style='color:white; align='center''>" .$row['DoctorID']. "</p>";
  19. echo "<p style='font-size: 20px; text-align:center'>" .$row['DoctorName']. "</p>";
  20. echo "<p style='text-align:center'>" .$row['gender']. "</p>";
  21. echo "<p style='text-align:center'>" .$row['speciality']. "</p>";
  22.  
  23. echo "<a class='btn btn-info btn-lg 'class='center-block'' href='doctor_schedules.php?>' style='font-size:15px; margin-bottom: 25px; margin-top:10px; margin-left:20px; margin-right:20px;'><span class='glyphicon glyphicon-pencil'>Book Appointment</span></a> ";
  24. echo "</div>";
  25.  
  26. }
  27. }else{
  28. echo "0 results";
  29. }
  30. $conn->close();
Add Comment
Please, Sign In to add comment