[SOLVED] LIKE %
Posted: Thu Jun 24, 2004 3:48 am
I am trying to make a search form.. with the following query..
however i am kinda stuck on how i can do this..
however i am kinda stuck on how i can do this..
Code: Select all
// form..
if (isset($_POST['submit']))
{
echo '<table><tr>';
require_once('inc/db.inc');
$result = mysql_query('SELECT * FROM table WHERE item1 LIKE '.$_POST['item1'].'% item2 LIKE '.$_POST['item3'].'% item4 LIKE '.$_POST['item4'].'%');
while($row = mysql_fetch_assoc($result)) {
echo '<td><a href="http://'.$_SERVER['HTTP_HOST'].'/index.php">'.$row['something'].'</a></td>';
}
echo '</tr></td></table>';
}