Jump to content

[SOLVED] Help with coding


dachshund

Recommended Posts

Hi,

 

I currently have this coding

<?php

$sql="SELECT * FROM events ORDER BY id DESC LIMIT 10";
$result=mysql_query($sql);

while($rows=mysql_fetch_array($result)){
?>
<table width="100%" border="0" align="center" cellpadding="5" class="bottomborder">
	<tr>
		<td align="left" valign="top" bgcolor="#FFFFFF" class="condensedeventcontent" rowspan="2" width="110" height="75">
            <a href="http://www.onthehuh.com/events/view_event.php?id=<? echo $rows['id']; ?>"><img src="<? echo $rows['smallimage']; ?>" border="0" /></a>
            </td>
		<td align="left" valign="top" bgcolor="#FFFFFF" class="condensedeventtitle">
            <a href="http://www.onthehuh.com/events/view_event.php?id=<? echo $rows['id']; ?>"><? echo $rows['title']; ?></a>
            </td>
	</tr>
	<tr>
		<td align="left" valign="bottom" bgcolor="#FFFFFF" colspan="2" class="condensedeventcontent"><? echo $rows['venue']; ?>
            </td>
	</tr>

<?php
}
mysql_close();
?>
</table>

 

Which posts all events listed, with the newest listed first.

 

I want to change it so that the events are only listed if they are currently on, so i need a code which tells the event only to be listed if todays date is inbetween the startdate and enddate.

 

Any ideas?

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/105833-solved-help-with-coding/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.