I am trying to get a mysql select to work but it doesn't give any results back. I'd like to get 1 result back from the database by using a form / dropdown.
The searchstring needs to check if those 3 selects exists in the database and echo them in a table.
Here is my code.
<?php
$year=$_POST['year'];
$month=$_POST['month'];
$day=$_POST['day'];
$colid=$_POST['colid'];
{
echo "
<table><tr><td><b>Titel</b></td><td> </td>
<td><b>Bestandsnaam</b></td><td> </td>
<td><b>Categorie</b></td><td> </td>
<td><b>Categorie</b></td><td> </td>
<td><b>Bekijk post op</b></td>
";
}
include_once"include/db/mysqldb.php";
$query=mysql_query("SELECT * FROM 'urenoverzicht' WHERE colid='$colid' AND year='$year' AND month='$month' AND day='$day'");
while($data = mysql_fetch_array($query))
$id = $data['id'];
$year = $data['year'];
$month = $data['month'];
$day = $data['day'];
$hours = $data['hours'];
{
echo "
<tr><td>".$year."</td><td> </td>
<td>".$month."</td><td> </td>
<td>".$day."</td><td> </td>
<td>".$hours."</td><td> </td>
<td><a href='change.php?id=".$id."'>Bewerk</a></td><p>
";
echo "</tabel>";
}
?>
I think it has to do with my query but i can't seem to find it, please help if you can direct me on the right path.