Advertisement
Guest User

Untitled

a guest
Dec 30th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "vertrigo";
  5. $dbname = "db";
  6.  
  7. $conn = new mysqli($servername, $username, $password, $dbname);
  8. if ($conn->connect_error) {
  9.     die("Connection failed: " . $conn->connect_error);
  10. }
  11.  
  12. function an($hora){
  13. global $conn;
  14. $data = date("d/m/Y");
  15. $sql = "SELECT * from argenda where hora='$hora' && data='$data'";
  16. $result = $conn->query($sql);
  17. if($result->num_rows == 0){
  18.     return "Disponivel";
  19. } else{
  20.     return "Locado";
  21. }
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement