The code is this:
<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();
$query = mysql_query("SELECT * FROM user_info WHERE 1_name LIKE '%$searchresult%' OR WHERE 2_name LIKE '%$searchresult%'") or die(mysql_error());
$total = mysql_num_array($query);
if ($total!=0) {
while ($row = mysql_fetch_array($query)) {
echo $row["1_name"];
echo " ";
echo $row["2_name"];
echo "<br>";
echo "<br>";
}
}
else
{
echo "Sorry there results to display.";
}
?>
</div>
</center>
</body>
</html>
i get this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE 2_name LIKE '%"the search result%'' at line 1
Were i wrote the search result is what the user input is.
Any help will be happily accepted,
jakx12