I've two mysql tables: One which holds a date / time / description. Second one holds also the time the user can select. Just a simple list with 8:30,9:00 and so on.
Now i want wants to check by date when a time is beable it shows just the table Time, but with except the time which was in agenda already used.
My code so far:
public function checkTime($date){
// loop trough agenda, by date which i get from the function parameter
$fetch = $this->dbprocess()->prepare("SELECT * FROM agenda WHERE datum = :date");
$fetch->bindParam(':date', $date);
$fetch->execute(); // execute this one
// this is the query which gets the whole time data, get here data from $fetch and then display ONLY the data which isn't in use yet by agenda
$result = $this->dbprocess()->prepare("SELECT * FROM uren WHERE NOT uur IN (?)");
$result->execute(array("8:30,12:00")); // testing, this should be the data of agenda, so it gets the time which is in use by date from the first query
// display the time, with the time in agenda filtered(In this case only 8:30 , 12:00 should be filtered).
while($row = $result->fetch(PDO::FETCH_ASSOC)){
echo $row['uur'];
}
}
But it doesn't display anything.. It runs something stuck in NOT and IN , but idk how... It works if i do it as bindparams, and use Where .... AND .... , But this should work aswell...
I hope you understand my question, im really stuck.