Is it possible to apply formating font code as a result of a date time?
What I am trying to do is present a list of courses (the result of a query) and Would like to colour all the "am" times Blue and "pm" times Red.
I am just after a few pointers in the right direction.
A snippet of the existing code is below
Many thanks
NigeB
---->
$query = "SELECT courses.course_id, courses.course_date, courses.venue, UNIX_TIMESTAMP(courses.course_date) as unix_date, courses.username, venue.line1, venue.line2, venue.line3
FROM courses
LEFT JOIN venue ON courses.venue = venue.venue
WHERE course_date > curdate()
ORDER BY course_date, venue
LIMIT 3";
$res2 = mysql_query($query);
if ($myrow = mysql_fetch_array($res2)){
do {
printf("<td valign=top align=center class=gentext width=180><b>%s<font color=#336699>%s</font> %s<br>
<br>%s<br><br></b><font size=2>at</font><br><br>%s
<br><br>%s<br><br>%s</td>\n",
date("g:i ",$myrow["unix_date"]), date("a",$myrow["unix_date"]),date("l",$myrow["unix_date"]),date("jS F Y",$myrow["unix_date"]), $myrow["line1"], $myrow["line2"], $myrow["line3"]);
} while ($myrow = mysql_fetch_array($res2));
} else {
echo " ";
}
What I am trying to do is present a list of courses (the result of a query) and Would like to colour all the "am" times Blue and "pm" times Red.
I am just after a few pointers in the right direction.
A snippet of the existing code is below
Many thanks
NigeB
---->
$query = "SELECT courses.course_id, courses.course_date, courses.venue, UNIX_TIMESTAMP(courses.course_date) as unix_date, courses.username, venue.line1, venue.line2, venue.line3
FROM courses
LEFT JOIN venue ON courses.venue = venue.venue
WHERE course_date > curdate()
ORDER BY course_date, venue
LIMIT 3";
$res2 = mysql_query($query);
if ($myrow = mysql_fetch_array($res2)){
do {
printf("<td valign=top align=center class=gentext width=180><b>%s<font color=#336699>%s</font> %s<br>
<br>%s<br><br></b><font size=2>at</font><br><br>%s
<br><br>%s<br><br>%s</td>\n",
date("g:i ",$myrow["unix_date"]), date("a",$myrow["unix_date"]),date("l",$myrow["unix_date"]),date("jS F Y",$myrow["unix_date"]), $myrow["line1"], $myrow["line2"], $myrow["line3"]);
} while ($myrow = mysql_fetch_array($res2));
} else {
echo " ";
}