Sorrow Posted May 22, 2009 Share Posted May 22, 2009 Hi, I am currently buiding a movie website and for my release dates section i want to display the upcomming dvd release but when a date is passed I dont want to display it anymore without deleting it how would I go about that please. Here is my code for that part // get the info from the db $sql = "SELECT `relID` , `relTitle` , `relDirector` , `relCase` , `relDate` FROM dvdRelease ORDER BY `relDate` LIMIT $offset, $rowsperpage"; $result = mysql_query($sql, $con); //echo "<table bgcolor='#000000' border = '0' cellpadding = '10' cellspacing = '5' >"; // while there are rows to be fetched... while ($list = mysql_fetch_assoc($result)) { ?> <table> <tr><td> <a href ='<?=$list['relCase']?>' style="outline-color:#000000" ><img src=<?=$list['relCase']?> height="85" width="65" Border="0"></a></td><td width="25px"></td> <td><font color="ff0000"><b> <?=$list['relTitle']?></b> <br>Date de Sortie:</font><font color="#FFFFFF"> <?=$list['relDate']?> </font><font color="ff0000"> <br>Réalisateur(s) : <?=$list['relDirector']?> </td></tr></table><br /> </font> Quote Link to comment Share on other sites More sharing options...
Yeodan Posted May 22, 2009 Share Posted May 22, 2009 I only read the first part, didn't even look at the code but something like this? if (releasedate > currentdate) { echo ... } Quote Link to comment Share on other sites More sharing options...
Axeia Posted May 22, 2009 Share Posted May 22, 2009 HAVING datefield > NOW() Quote Link to comment Share on other sites More sharing options...
Sorrow Posted May 22, 2009 Author Share Posted May 22, 2009 Thank you very much for the reply This (HAVING datefield > NOW()) worked fine and is really simple Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.