|
|
$userstable = "jobs_tbl"; /* MySQL table created to store the data */
$dbName = "schoollaw";
$titlesearch = (ereg_replace("'", "`", $titlesearch));
$citysearch = (ereg_replace("'", "`", $citysearch));
$districtsearch = (ereg_replace("'", "`", $districtsearch));
/* make connection to database */
MYSQL_CONNECT(208.110.132.7,lawschool,current) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
/*Establish the SQL query*/
$query = "SELECT
schoolunit,
title,
county,
DATE_FORMAT(postdate, '%c/%d/%Y'),
recordid
from $userstable WHERE title LIKE '%$titlesearch%' AND city LIKE '%$citysearch%' AND schoolunit LIKE '%$districtsearch%' AND county LIKE '%$countysearch%' AND hidden != 'x' ORDER BY postyear DESC, postmonth DESC, postday DESC";
$result = MYSQL_QUERY($query);
/*Determine how many records match the query*/
$number = MYSQL_NUMROWS($result);
IF ($number == 0) :
PRINT "
Total number of job postings found: $number
"; ENDIF; MYSQL_CLOSE(); ?> |