Searching Dates
Posted: Wed Jan 19, 2005 7:34 am
Im using this code to search my database for a particular date, this code worked fine when I was searching text i.e, names but when I search for dates it doesnt produce results even if I put in the exact copy of a date which I know exists.
Can anyone see where I am going wrong or give me any advice or another way to search dates in php.
Can anyone see where I am going wrong or give me any advice or another way to search dates in php.
Code: Select all
foreach($HTTP_POST_VARS as $varname => $value)
$formVarsї$varname]=$value;
// the query used to search the DB
$query = "SELECT *, DATE_FORMAT(`dateoflastcontact`, '%d/%m/%y')
AS `dateoflastcontact`, FROM `people` WHERE 'dateoflastcontact' LIKE '$formVarsїdateoflastcontact]%'";
$result = mysql_query($query);