Hi,
At the moment my member search works, however when I search for a member called 'Will' it gives the result 'Sam' first because in his biography he has the work Will, and he is above Will in the MySQL table. Is there a way to give the results that usernames match first, then the results that the biographies match. Here is a link t my search bar: http://www.blu-byte.co.cc/members/search/quick.php/. Try searching for Will, you will see what I mean.
Here is my current search code:
$searchqu = mysql_query("SELECT * FROM $tbl_name WHERE usr OR bio LIKE '%$search%'");
//Draw table titles
echo "<table border='1' cellpadding='5' cellspacing='1' style='width: 75%' >";
echo "<tbody>";
echo "<tr>";
echo "<td>";
echo "<p><span style='font-family:tahoma,geneva,sans-serif;'><span style='font-size:20px'> Name </span></span></p>";
echo "</td>";
echo "<td>";
echo "<p><span style='font-family:tahoma,geneva,sans-serif;'><span style='font-size:20px'> Biography </span></span></p>";
echo "</td>";
echo "</tr>";
while($rows = mysql_fetch_array($searchqu))
{
$usr = $rows['usr'];
$bio = $rows['bio'];
if ($usr)
{
echo "<tr>";
echo "<td>";
echo "<p><span style='font-family:tahoma,geneva,sans-serif;'><strong> $usr </strong></span></p>";
echo "</td>";
echo "<td>";
echo "<p><span style='font-family:tahoma,geneva,sans-serif;'> $bio </span></p>";
echo "</td>";
echo "</tr>";
}
else
{
echo "<p><span style='font-family:tahoma,geneva,sans-serif;'>Sorry but we weren't able to find any members for the search $search.</span></p>";
}
}
echo "</tbody>";
echo "</table>";
}
Many thanks in advance.