View Single Post
Old 05-23-2005, 01:51 AM   #4 (permalink)
Limit
Inactive
 
Join Date: 10-29-03
Posts: 249
iTrader: 0 / 0%
Latest Blog:
None

Limit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the roughLimit is a jewel in the rough
when using this:-
PHP Code:
                @require "includes/connect.php";
                    
$search $_POST['search'];
                    
$explode explode(" "$search);
                 
$search "biz_name LIKE '%" implode("%' OR biz_name LIKE '%"$explode) . "%'";
                    
$count count($explode);
                    
$query = array();
                    echo 
"<p><strong style=\"font-size: 13px;\">Search Results</strong></p>";
                    for (
$i=0$i $count$i++){
                     
$query[$i] = mysql_query("SELECT biz_name, biz_description, biz_website FROM businesses WHERE $search");
                 if (@
mysql_num_rows($query[$i]) == 0) {
                     echo 
"There are currently no listings for this category.";
                    }
                 while (@
$row mysql_fetch_assoc($query[$i])) {
                  
$row['biz_description'] = str_replace("\n""\n<br />"$row['biz_description']);
                     echo 
"<p style=\"padding: 10px; border: 1px dashed #C4C4C4; width: 96%;\"><a href=\"http://".$row['biz_website']."\" onclick=\"window.open(this.href,'_blank');return false;\"><strong>".$row['biz_name']."</strong> - <em>".$row['biz_website']."</em></a><br />";
                     echo 
$row['biz_description'];
                     echo 
"</p>";
                    }
                    } 
It returns two results when i search 'webmaster forum' one for webmaster the other for forum can i fix this. so that is still searches for both biz_name LIKE 'webmaster' OR biz_name LIKE 'forum' but only show one result.
Limit is offline   Reply With Quote