Hey i hope somebody can show me how to retrieve data by date from a mysql database.
I have to coloms called dato and datoslut
dato is the starting date from which the data should be displayed and datoslut is the finishing date from which the data should be displayed.
But it dosen´t work that way at the moment ?
require('connection.php');
db_connect();
$date = date("y.m.d");
$query = "SELECT * FROM voicefront WHERE (dato >= '$date') AND (datoslut >= '$date') ORDER BY number";
$result = mysql_query($query);
while ( $a = mysql_fetch_object( $result ) )
{
if ( $a->radio == "kbh" )
{
print "<tr><td width='2' bgcolor='#B8D3C5'></td><td align='center' height='20' class='overskrift' bgcolor='#FFFFFF'><b><font size='2'><b>$a->titel</font></b></td><td width='2' bgcolor='#B8D3C5'></td></tr>";
print "<tr><td colspan='3' height='20' bgcolor='#B8D3C5'></td></tr>";
print "<tr><td width='2' bgcolor='#B8D3C5'></td><td bgcolor='#D2EADD'>$a->tekst</td><td width='2' bgcolor='#B8D3C5'></td></tr>";
print "<tr><td width='2' bgcolor='#B8D3C5'></td><td align='right' height='20' bgcolor='#D2EADD'><a href='underside.php?value=$a->id' target='main'><b>Klik her</b></a> og læs mere</td><td width='2' bgcolor='#B8D3C5'></td></tr>";
print "<tr><td width='2' bgcolor='#B8D3C5'><td width='2' bgcolor='#D2EADD' height='20'><td width='2' bgcolor='#B8D3C5'></tr>";
}
}
?>