ok so here is the code, this is for the search option on my site. However it only ever outputs: the else option. Whats wrong?
<html>
<head>
<link rel=stylesheet type=text/css href=style.css>
<title>
Search Results
</title>
</head>
<body>
<?php include("header.php"); ?>
<center>
<div class=indexboxlarge2>
<?php
SESSION_start();
include("dbcon.php");
$searchresult = $_POST['result'];
dbcon();
$name = str_replace(".", " ", $row["username"]);
$query1 = mysql_query("SELECT * FROM user_info WHERE 1_name LIKE '%{$searchresult}%' OR 2_name LIKE '%{$searchresult}%'OR username LIKE '%{$name}%'");
$total = mysql_num_rows($query1);
if ($total<0) {
while ($row = mysql_fetch_array($query1)) {
echo $row["1_name"];
echo " ";
echo $row["2_name"];
echo "<br>";
echo "<br>";
}
}
else
{
echo "Sorry there results to display.";
}
?>
</div>
</center>
</body>
</html>