[thelist] SQL query help
Tarrant Costelloe
taz at insur-e.net
Fri Nov 8 09:36:00 CST 2002
Can you see what's wrong with this then cause I am getting errors still,
thank you.
------------------------------------
// Get most popular blog for the week
$PopularBlogWeekQuery="SELECT * from blogs WHERE blog_author =
\"$member_username\" AND MONTH(blog_date) = 12 ORDER BY blog_hits DESC";
$PopularBlogWeekResult=mysql_db_query($database,$PopularBlogWeekQuery,$link)
;
while
($PopularBlogWeekRow=mysql_fetch_array($PopularBlogWeekResult))
{
$PopularBlogWeekCount++;
if($PopularBlogWeekCount++ < 2)
{
echo $PopularBlogWeekRow[blog_subject];
}
}
------------------------------------
-----Original Message-----
From: listman at hazard0us.org [mailto:listman at hazard0us.org]
Sent: 08 November 2002 12:39
To: thelist at lists.evolt.org
Subject: RE: [thelist] SQL query help
With MySQL you have to use MONTH(DATE) instead of datepart().
ashok
------
Ashok Hariharan
http://www.unganisha.org
------
--
For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
Please support the community that supports you.
http://evolt.org/help_support_evolt/
More information about the thelist
mailing list