Name: Anonymous 2007-07-13 3:44 ID:Ak4R4Bn8
In before noob flame, thank you.
I'm like trying to create a PHP search script for my website. So far I have two files: index.php and search.php
form of index.php looks like this:
<div id="search">
<form method="post" action="search.php">
<input type="text" name="search">
<input type="submit" value="Search!">
</form>
</div>
search.php file looks like this:
<?php
$search_result = 0;
$query = " SELECT * FROM items WHERE itemid LIKE '%$search%' ";
$search_result = mysql_query($query) or die(mysql_error());
if ($search_result > 0) {
search_result($search_result);
}
else {
echo " No results to display! ";
}
?>
What the fuck I am doing wrong?
I'm like trying to create a PHP search script for my website. So far I have two files: index.php and search.php
form of index.php looks like this:
<div id="search">
<form method="post" action="search.php">
<input type="text" name="search">
<input type="submit" value="Search!">
</form>
</div>
search.php file looks like this:
<?php
$search_result = 0;
$query = " SELECT * FROM items WHERE itemid LIKE '%$search%' ";
$search_result = mysql_query($query) or die(mysql_error());
if ($search_result > 0) {
search_result($search_result);
}
else {
echo " No results to display! ";
}
?>
What the fuck I am doing wrong?