Jump to content


Photo

Order by specific month


  • Please log in to reply
No replies to this topic

#1 monkeybidz

monkeybidz
  • Members
  • PipPipPip
  • Advanced Member
  • 330 posts

Posted 13 March 2006 - 04:23 AM

Hello, all. Im new to this forum, and im stuck. Maybe someone here can help.
First of all, let me explain what i am trying to do.
I am try to have query result items starting by certian month. The current query i am using calls all months.
Here is the current query(sloppy):
$query = "select a.id, a.title, u.nick, a.auction_type, a.buy_now, a.relist, a.starts, a.closed from PHPAUCTION_auctions a, PHPAUCTION_users u, PHPAUCTION_durations d where u.id=a.user and u.id='$id' and u.nick=u.nick and a.buy_now=a.buy_now and a.relist=a.relist and a.closed=a.closed and a.id=a.id and a.auction_type=a.auction_type order by a.starts ASC limit $offset, $limit";


a.starts table setting = varchar(14) default NULL

$ID = mysql_result($result,$i,"id");
$title = stripslashes(mysql_result($result,$i,"title"));
$auction_type = mysql_result($result,$i,"a.auction_type");
$tmp_date = mysql_result($result,$i,"starts");
$duration = mysql_result($result,$i,"duration");
$auction_id = mysql_result($result,$i,"a.id");
$month = substr($tmp_date,4,2);
$day = substr($tmp_date,6,2);
$year = substr($tmp_date,0,4);
$date = "$month/$day/$year";
$buy_now = mysql_result($result,$i,"a.buy_now");
$closed = mysql_result($result,$i,"a.closed");
$relist = mysql_result($result,$i,"a.relist");
$nick = mysql_result($result,$i,"nick");


This month should be January
thanks in advance!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users