Hi
I'm trying to do a php search system that looks through my database for varrious records depending on the value selected from a combo box. At the moment it works but there are two things I cant work out.
The code for the search is:
switch ($_REQUEST['search_by'])
{
case "user_uni":
{
$sql = "SELECT * FROM tbl_user WHERE user_uni = '{$_REQUEST['search']}'";
$result = mysql_query($sql) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
extract($row);
echo "University: $user_uni Username: $log_name<br><hr><br>";
break;
}
}
case "log_name":
{
$sql = "SELECT * FROM tbl_user WHERE log_name LIKE '{$_REQUEST['search']}'";
$result = mysql_query($sql) or die (mysql_error());
while ($row = mysql_fetch_array($result)){
extract($row);
echo $row;
break;
}
}
At the moment it will only return one row of data and it returns that at the bottom of the search form which is an include file.
Does anyone know how I can get every row of data to show up and how I can get it to show up in a different page?
Thanks