Course Reserve Search Results Today is ' .(date('l, F d, Y')) .'

'; echo 'Return to search page'; $searchtype=$_POST['searchtype']; $searchterm=$_POST['searchterm']; $searchtype=trim($searchtype); $searchterm=trim($searchterm); $searchtype=addslashes($searchtype); $searchterm=addslashes($searchterm); // $localhost='163.238.11.106'; Switched to colocussus database server $localhost='163.238.11.95'; $dbcnx = @mysql_connect($localhost,'Anonymous',''); $i=1; if (!$dbcnx) { die( '

Unable to connect to Server.

' ); } if (! @mysql_select_db('textbooks') ) { die( '

Unable to locate the database.

' ); } if (empty($searchterm)) { echo '

Sorry, but you have not entered search term yet. Please go back and try again.

'; exit; } elseif ($searchterm=='all') { echo '

You chose to search by ' .$searchtype. ' for all the holdings.

'; $query = "SELECT * FROM textbooks ORDER BY ".$searchtype.""; } else { echo '

You chose to search by ' .$searchtype. ' with ' .$searchterm. ' as keyword(s).

'; $query = "SELECT * FROM textbooks WHERE ".$searchtype." like '%".$searchterm."%' ORDER BY ".$searchtype.""; } $result = mysql_query($query); if (!$result) { die('

Error performing query: ' . mysql_error() . '

'); } $rowsFound= mysql_num_rows($result); if($rowsFound>0) { echo '

' .$rowsFound .' item(s) found matching your criteria, order by ' .$searchtype. ':
'; echo '(Bring the call number of the item you want to the Circulation Desk.)

'; echo '' . '' . '' . ''; while ($row = mysql_fetch_array($result)) { if ($i % 2 !=0) # Odd row $rowcolor="#98AFC7"; else # Even row $rowcolor="#FFFFFF"; echo ''. '' . '' . '' . ''; $i++; # increment count } // echo '
AuthorTitleCall Number
' . stripslashes($row['author']) . '' . stripslashes($row['title']) . '' . stripslashes($row['callnum']) . '
'; } else { echo '

Sorry, but no items were found that matched your criteria.

'; echo 'Return to search page'; } echo '

'; ?>