On the side there's a box that says "Upcoming Events >"
It is pulling the table and displaying only the rows that have the month as the current month. However I want it to do that as well as ordering it, because right now the days are out of order.
The table name is:
event_2
The fields are:
month
day
event
This is the code I have right now:
Code: Select all
<?
$username="";
$password="";
$database="";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$result=mysql_query("select * from event_2 where month=".
date("n"));
for($i=1;$i<=mysql_num_rows($result);$i++){
$row=mysql_fetch_array($result);
?>
<b><? echo $row['month'] ?>/<? echo $row['day'] ?></b> - <? echo $row['event'] ?><br>
<?
}
?>I need help in ordering the rows using 'day'
I can't seem to get it. I tried ORDER by day
and still nothing, I get errors.