Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 <?php
- 2 include 'include/db_check.php';
- 3
- 4 if ($result = $mysqli->query("SELECT *
- 5 FROM jarig
- 6 WHERE datum >= CURDATE() and datum <= DATE_ADD(CURDATE(), INTERVAL + 7 DAY)
- 7 ORDER BY datum ASC"))
- 8 {
- 9 // display records if there are records to display
- 10 if ($result->num_rows > 0)
- 11 {
- 12 while ($row = $result->fetch_object()){
- 13 $date = new DateTime($row->datum);
- 14
- 15 echo "'" . $date->format('d') . " " . $row->maand . " ". $row->naam . " ";
- 16 echo "<br />";
- 17 }
- 18
- 19 }
- 20 // if there are no records in the database, display an alert message
- 21 else
- 22 {
- 23 echo "Nog niemand jarig...";
- 24 }
- 25 }
- 26 // show an error if there is an issue with the database query
- 27 else
- 28 {
- 29 echo "Error: " . $mysqli->error;
- 30 }
- 31
- 32 // close database connection
- 33 $mysqli->close();
- 34
- 35 ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement