here is the code. something is wrong. i have the search page setup correctly. I want them to ony search by state. they will type in the state and then it brings up all the states. the profile link isn't active either..PLEASE HELP its for my final. Thanks
i do have an connection
😕
<?php
$maxRows_Recordset1 = 12;
$pageNum_Recordset1 = 0;
if (isset($GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
$colname_Recordset1 = "1";
if (isset($POST['id'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $POST['id'] : addslashes($_POST['id']);
}
mysql_select_db($database_myconnect, $myconnect);
$query_Recordset1 = "SELECT state, username FROM models ORDER BY state";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $myconnect) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
$susername = $POST['username'];
$sstate = $POST['state'];
$sSql = "SELECT username, state FROM models WHERE username LIKE '%{$susername}%' AND state LIKE '%{$sstate}%'";
$result = mysql_query($sSql);
if(! $result)
{
echo "SQL failed to select item.";
exit();
}
$number_of_rows = mysql_num_rows($result);
$record = mysql_fetch_assoc($result);
?>