please why do i receive this error. when i try to make a new search, that's the error i get. below is my code. what did i do wrong?
<?php
define('DB_HOST','localhost');
define('DB_USER','user');
define('DB_PASS','pass');
define('DB_NAME','dbname');
$conn = mysql_connect(DB_HOST,DB_USER,DB_PASS) or die(mysql_error());
mysql_select_db(dbname) or die(mysql_error());
$output = '';
if(isset($_POST['search'])) {
$searchq = $_POST['search'];
$searchq = preg_replace("#[^0-9a-z]#i", "",$searchq);
$query = "SELECT * FROM track WHERE keywords LIKE '%$searchq%'";
$count = mysql_num_rows($query);
if($count == 0) {
$output = 'There was no search results!';
}
else {
while($row = mysql_fetch_array($query)) {
$consignee = $row['consignee'];
$desti = $row['desti'];
$date = $row['date'];
$output = "<table class=\"zebra\"><thead><tr><th>Consignee</th><th>Destinations / Remarks</th><th>Date</th></tr></thead><tfoot><tr><td>$consignee</td><td>$desti</td><td>$date</td></tr></tfoot></table>";
}
}
}
?>