Jay Blanchard wrote:
[snip] $query = "SELECT empnum,name,hdate,Photo,(YEAR(Curdate()) - YEAR(hdate)) as timein FROM emp2 where mo nth(hdate)=$mymonth and empnum < "9999" order by timein"; [/snip]
Change to single quotes around data $query = "SELECT empnum,name,hdate,Photo,(YEAR(Curdate()) - YEAR(hdate)) as timein FROM emp2 where month(hdate)=$mymonth and empnum < '9999' order by timein";
And if empnum is a number, rather than a string, drop the quotes altogether:
$query = "SELECT empnum,name,hdate,Photo,(YEAR(Curdate()) - YEAR(hdate)) as timein FROM emp2 where month(hdate)=$mymonth and empnum < 9999 order by timein";
Michael
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]