jakx12
01-26-2009, 11:09 AM
Here's the code, it gives me this error: Parse error: syntax error, unexpected T_LNUMBER in /home/a8896310/public_html/searchresult.php on line 22
And the code:
<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();
$sql = 'SELECT * FROM user_info WHERE 1_name LIKE '%$searchresult%' OR WHERE 2_name LIKE '%$searchresult%';
$query = mysql_query($sql) or die(mysql_error());
$total = mysql_num_rows($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>
Any help will be much appreciated, thanks.
And the code:
<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();
$sql = 'SELECT * FROM user_info WHERE 1_name LIKE '%$searchresult%' OR WHERE 2_name LIKE '%$searchresult%';
$query = mysql_query($sql) or die(mysql_error());
$total = mysql_num_rows($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>
Any help will be much appreciated, thanks.