now i'm getting the following:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /const/a_searchlist.php on line 36
here is the db code:
session_start(); // Turn on the session variables
ini_set('display_errors', true); // I want PHP Information On Screen
error_reporting( E_ALL ); // I want as much Debug Info I can get when I code
include ('db_conn.php');
$db = mysql_connect($servhost, $servuser, $servpwd);
if ( !$db ){
exit( "Connection Failed" );
}
$dbn = ($dbsname);
if(!mysql_select_db($dbn, $db) ){
exit( "DB Selection Failed" );
}
// see if SESSION have some such value, otherwise = '' = empty
$cst_id = isset($_SESSION['constid']) ? $_SESSION['constid'] : '';
if( !empty($cst_id) ){
$sql = "SELECT * FROM $tabname ORDER BY lastname WHERE lastname = '".$_POST['lastname']."%', AND firstname = '".$_POST['firstname']."%', AND dob = '".$_POST['dob']."%'";
}
else{
exit( "NOT LOGGED IN" );
}
// do the sql query and get result
$srchrs = mysql_query($sql);
// ARRAY to store the rows, if any
$all_rows = array(); // make an empty array
while($row = mysql_fetch_assoc($srchrs)){
$all_rows[] = $row; // store each row, if any
}
and line 36 would be:
// ARRAY to store the rows, if any
$all_rows = array(); // make an empty array
while($row = mysql_fetch_assoc($srchrs)){ <--(line 36)
$all_rows[] = $row; // store each row, if any
}