now heres the search form
index.php
---------------------------------------------------------------------------------
Code: Select all
<form action="/search/index.php" method="post">
<tr>
<td style="padding-left:30">Author: </td>
<td><input type="text" name="author" size="15" maxlength="256"></td>
</tr>
<tr>
<td style="padding-left:30">Item No: </td>
<td><input type="text" name="itemid" size="15" maxlength="256"></td>
</tr>
<tr>
<td style="padding-left:30">Price: </td>
<td>
<select name="price">
<option value=">= 0">- Any Price -</option>
<option value="<= 15">< 15</option>
<option value="<= 25">< 25</option>
<option value="<= 50">< 50</option>
<option value=">= 50">> 50</option>
</select></td>
</tr>
<tr>
<td colspan="2" style="padding-left:41">
<select name="category">
<option value="">- Any Category -</option>
<?php
$sql = mysql_query("SELECT * FROM categories ORDER BY templates ASC");
while ($row = mysql_fetch_array($sql)) {
echo "<option value='".$row['templates']."'>".$row['templates']."</option>";
}
?>
</select></td>
</tr>
<tr>
<td align="center" style="padding-left:40" colspan="2"><input type="image" src="/images/search_but.jpg" border="0" width="68" height="24" style="border: thin solid #ffffff;"></td>
</tr></form>
---------------------------------------------------------------------------------
search.php
---------------------------------------------------------------------------------
Code: Select all
$result = mysql_query("SELECT * FROM templates WHERE
author='".$_POST['$author']."' OR id='".$_POST['$itemid']."' OR
category='".$_POST['$category']."' AND price ".$_POST['$price']." LIMIT
".(($current - 1) * $count).", " . $count);
---------------------------------------------------------------------------------
i get no errors, it just displays the wrong results, or doesnt show anything sometimes, but when i play with the code, it kind of works, lol