Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // $DB_SERVER = "localhost";
- // $DB_USERNAME = "root";
- // $DB_PASSWORD = "";
- // $DB_DATABASE = "eve";
- // $dbh = new mysqli($DB_SERVER, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
- // if ($dbh->connect_error)
- // {
- // die("Connectie Fout: " . $dbh_connect_error);
- // }
- $hostname='127.0.0.1';
- $dbname='eve';
- $username='clifton';
- $password='password';
- try{
- $dbh = new PDO("mysql:host=$hostname;Database=$dbname", $username, $password);
- }catch(PDOException $e ){
- echo "Error: ".$e;
- }
- ?>
- <?php
- include("config.php");
- $end = date('Y-m-d 23:59:59',strtotime('this sunday'));
- switch (date('N', strtotime('today'))) {
- case '5':
- case '6':
- case '7':
- $start = date('Y-m-d H:i:s:', strtotime('now'));
- break;
- default:
- $start = date('Y-m-d 00:00:00', strtotime('this friday'));
- break;
- }
- $sql = $dbh->prepare("SELECT * FROM event WHERE `time` BETWEEN `time` = :starttime AND `time` = :endtime");
- $sql->bindValue(':starttime', $start);
- $sql->bindValue(':endtime', $end);
- $sql->execute();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement