On 02-Feb-2004 Michael Hill wrote:
> Hi everyone,
> heres the code i have:
>
> $strSQL = "SELECT date from ".$tbl_prefix."news where live=1 order
> by
> date asc limit 0,1";
> $result = mysql_query($strSQL,$dbconn);
> $firstresult = mysql_fetch_array($result);
> $firstdate = $firstresult[
Michael,
Let the database do the work. Check your MySQL docs (assuming you are using
MySQL, otherwise check what you have ) for the month() function. Use this
in your SELECT, aliasing it so that you do not use the term "month", say
pub_month. Your SQL would then look like this
$strSQL =
Hi everyone,
I have made written some code (really bad code,I'm sure), that finds the
earliest month that has a news story, and the latest month that has a
news story. the code is below. I now need to loop through somehow, to
build an array, that gives me the month (JAN,FEB,MAR) and the year it
bel
3 matches
Mail list logo