I've taken over a website from someone else and I have very little knowledge of PHP. The site includes a search page where you can search a database of work placements. Currently the search displays all work placements including ones which are past their closing date. I want to be able to change the code so that it only displays placements that are current (i.e. the ones with a date ahead of the current date). The current code which searches the databases is here:
Code: Select all
$query = "select tblPlacementData.placementid as id, tblPlacementData.*, tblCompanies.* from tblPlacementData, tblCompanies
where tblPlacementData.companyid = tblCompanies.companyid AND
companyname like '%".$compname."%' AND
jobtype like '%".$jobtype."%' AND
location like '%".$location."%' AND
information like '%".$information."%'
";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);Code: Select all
$query = "select placementid, companyid, jobtype, location, closingdate from tblPlacementData
where UNIX_TIMESTAMP(dateadded) <= $lastlog
AND to_days(closingdate) - to_days(now()) >= 0
order by closingdate asc";Thanks