Código PHP:
<?php
if (!defined('WEB_ROOT')) {
exit;
}
?>
<form name="form1" method="post" action="buscar.php">
<p>Busqueda rapida
<input name="busca" type="text" id="busca" />
<input type="submit" name="Submit" value="buscar" />
</p>
<p> </p>
</form>
<?php
if(isset($_POST['buscar']) && !empty($_POST['busca']))
{
$busca=$_POST['busca'];
$busqueda = mysql_query("SELECT * FROM tbl_product WHERE pd_description LIKE '%".$busca."%'");
while($f = mysql_fetch_assoc($busqueda)){
$pd_thumbnail = $f['pd_thumbnail'];
if (!empty($pd_thumbnail) && $pd_thumbnail != "") {
$pd_thumbnail = WEB_ROOT . 'images/product/' . $pd_thumbnail;
} else {
$pd_thumbnail = WEB_ROOT . 'images/no-image-small.png';
}
echo "<img src='".$pd_thumbnail."'> ".$f['pd_description']." ".$f['pd_price']."<br>";
}
}
?>