search mysql table using php
Posted: Mon Mar 09, 2009 3:22 pm
there is something wrong with this code what ever i search for i gives me
need help
no result found
Code: Select all
<form name="form" action="" method="get">
<input type="hidden" name="action" value="srch"/>
<input type="text" name="search" />
<input type="submit" name="Submit" value="Search" />
</form>
<?php
$count=0;
$i=0;
if ($_REQUEST["action"]=='srch'){
$fechdbase=mysql_query("select count(*) from Links
where
srch='".$_REQUEST["name"]."' || '".$_REQUEST["url"]."'");
$result=mysql_fetch_array($fechdbase);
if ($result[0]!=0){
while ($result[$i]!=count($result)){
echo '<td> <a href="http://'.$result["url"].'">
<img src="http://'.$result['picture'].'" width=150 height= 200></a></td>';
$count++;
if ($count==3){
echo '</tr><tr>';
$count=0;
}//end if
$i++;
}//end while
echo '</tr>';}
else{
echo 'no result found';}}
?>