Hi guys.
I am trying to check the day of the week by the date.
In my database i store my date/time as 2005-05-01
I want to be able to get the day. at present my script returns as above but i would also like to set up a Var to hold the Day "name"
So it would be visDate=2005-05-01&visDay=Monday
//VisDate is sent throught the Url
$query = "SELECT * FROM scVisitors
WHERE DATE_FORMAT( visitDate, '%M' ) = '$visDate'
ORDER BY visitDate";
// Execute query
$result = mysql_query($query);
// If query failed...
if (!$result) {
// Inform Flash of error and quit
fail("Couldn't list visits from database");
}
// Find out how many rows of dat there is
$dateCount = mysql_num_rows($result);
// Setup our variable to hold output
$output = "dateCount=$dateCount";
// For each row returned...
for ($count = 0; $count < $dateCount; $count++)
{
// Extract row details from database
$theDate = mysql_fetch_array($result);
$noVisits = $theDate['visCount'];
$visitDate = $theDate['visitDate'];
$visitDate = substr($visitDate, -2);
//
$output .= "&theDate" . $count . "noVisits=" . $noVisits;
$output .= "&theDate" . $count . "visitDate=" .$visitDate;
$output .= "&theDate" . $count . "visDay=" .$visDay;
}
// Output all rows in one go
echo $output;
Anyone??
Thanks
Paul