jtrudeau
asked on
searching by the month only
Im try to find the right query to compare the month only of the last record, if the month is the current month do something
$today = date("m");
$obj = mysql_query ("SELECT DATE_FORMAT(printDate, '%m') AS f_date FROM prints ORDER BY printDate DESC LIMIT 0,1")
or die ("Invalid query");
$oRow = mysql_fetch_object($obj);
I would think to put a WHERE is the query but doesnt sound like it would work properly
please help me out
$today = date("m");
$obj = mysql_query ("SELECT DATE_FORMAT(printDate, '%m') AS f_date FROM prints ORDER BY printDate DESC LIMIT 0,1")
or die ("Invalid query");
$oRow = mysql_fetch_object($obj);
I would think to put a WHERE is the query but doesnt sound like it would work properly
please help me out
ASKER
what is with the ampersand ?
ASKER
and month(date) will do what, what you sent me it appears that month() is a function but the argument date ????
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
not working :(
ASKER
yes! it does work, I have another question posted go check it out so I could accept this answer and accept your next answer
"WHERE Month(Date)= " & $today & " "