Displaying mySQL data if correct date!

I have only just started working in php so please forgive my ignorance!
I have built a page http://www.myliverpoolnetworking.co.uk/calendar.php

I am trying to display the data from the table i.e. event name in the list of dates below on the correct date.

I can set up an array from the database and display the results in a table but not sure how to check to see if the dates in the table and the dates in the list match and then to display the event name?

Heres my code so far!!!

[php]<?php
$config = “config.php”;

require($config);

//set database connection
$conn = @mysql_connect($DBIP,$DBUSER,$DBPASS) or die(“Err:Conn”);
@mysql_select_db($DBNAME,$conn) or die(“Err:Db”);

$sql = “select * from “.$DBTABLENAME.” order by eventDate”;

$rs = mysql_query($sql,$conn);
$dates = mysql_query($sql,$conn);

date_default_timezone_set(‘UK/London’);
$numDaysMonth = date(‘t’);
$month = date(‘m’);
$todayDay = date(‘Y-m-d’);
$firstDay = date(“Y”)."-". date(“m”) ."-" . “01” ;
$lastDay = date(“Y”)."-". date(“m”) ."-" . “$numDaysMonth” ;

?>

<? while($row = mysql_fetch_array($rs)) { ?> <?}?>
ID Event Name Date
<?=$row["id"]?>  <?=$row["eventName"]?>  <?=$row["eventDate"]?> 


<?php for($dayHolder = $firstDay; $dayHolder <= $lastDay; $dayHolder++) { if ($dayHolder == $todayDay) { print "" ; print "Name Of Event"; print "
"; print ($todayDay); print "
"; print "
"; } else { print ($dayHolder); print "
"; } } ?>[/php]

Many Thanks

Sponsor our Newsletter | Privacy Policy | Terms of Service