Guest User

Untitled

a guest
Jan 15th, 2019
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $host = "localhost";
  5. $user = "root";
  6. $pass = "";
  7. $db = "alumni";
  8.  
  9. $connect = mysql_connect($host, $user, $pass) or die ("Unable to connect to host");
  10.  
  11. //Select Database
  12.  
  13. mysql_select_db($db) or die ("Unable to connect to database");
  14.  
  15. $today = date("y"); // get today's date (month and day only!)
  16. $sql = "select * from users where bday='".$today."'";
  17. $list = mysql_query($sql);
  18. while ($lst = mysql_fetch_array($list))
  19. {
  20. echo ("Happy birthday " . $lst['username'] . "!<br>");
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. //$exp_date = "2012-10-12";
  34. //todays_date = date("Y-m-d");
  35.  
  36. //$today = strtotime($todays_date);
  37. //$expiration_date = strtotime($exp_date);
  38.  
  39. //if ($expiration_date == $today) {
  40.  //    echo "equal";
  41. //} else {
  42.      //echo "no";
  43. //}
  44.  
  45. ?>
Add Comment
Please, Sign In to add comment