I am a new learner and I would like to know my search query is corrected.
I have a table name bzs and I want to the result of the query to display all fields of the table.
I would be very gratful if you can look the coding below to spot the problem of the searching result
thanks
Resoum
$select = $_POST['contact_name'];
$searchdb = $_POST['searchdb'];
// make the query
$query = "SELECT contact_name, category, organisation, country, city, website , phone, email
FROM bzs
WHERE $select LIKE '%$searchdb%'";
$result = @mysql_query($query); // run query
$num = @mysql_num_rows($result);
if ($num > 0) {
echo "<p style=\"text-align: center\"><strong>There are currently $num of results.</strong></p>";
} else {
echo "<p style=\"text-align: center\"><strong>There are no matches in the database.</strong></p>";
}