Forum Moderators: coopster
function getDateLink($day, $month, $year)
{
include 'open.php';
GLOBAL $cnt; //$cnt has the value 0 as specified before
$cnt = 0; // Resetting $cnt to 0
$query="Select * From challenge Where confirmed = 'Yes' AND played = 'No' AND month = '$month' AND year = '$year' AND day = '$day'";
$result = mysql_query($query); $clanday='';
$clanmonth='';
$clanyear='';
$link = '';
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$clanday[]=$row['day'];
$clanmonth[]=$row['month'];
$clanyear[]=$row['year'];
$cnt++;
if(in_array($day,$clanday) and in_array($month,$clanmonth) and in_array($year,$clanyear))
{
$link = "displaymatches.php?day=$day&month=$month&year=$year";
}
}
return $link;
include 'close.php';
}
The problem is that this calendar only shows future matches from the CHALLENGE table. I need to also select values from my PLAYED table and have them inserted onto that calendar. Can anybody help?!
thanks
[edited by: jatar_k at 5:19 pm (utc) on Mar. 29, 2005]
[edit reason] removed url [/edit]
$query="Select challenge.day as cday,challenge.month as cmonth, challenge.year as cyear, played.day as pday, played.month as pmonth, played.year as pyear From challenge,played" .... etc
You'll need to specify which tables to use in your WHERE clause or it will complain about ambiguity.
Would I also need to edit the while statement? what would.. $clanday[]=$row['day']; become? as it is called "day" in both tables
And then change my if statement to something like...
if(in_array($day,$clanday) and in_array($month,$clanmonth) and in_array($year,$clanyear) OR in_array($day,$pldday) and in_array($month,$pldmonth) and in_array($year,$pldyear) )