What is the script to count the results of your search from a database? More specifically (or maybe another question) is how to display the result if it finds more than 3 words searched:. $searchTheseArr = explode(" ", $searchTheseArr); //echo count($searchTheseArr); $sql="SELECT * FROM db_table WHERE 1=1 AND"; for ($i=0; $i < count($searchTheseArr); $i++) { if(strlen($searchTheseArr[$i]) > 3){ $sql.=" text_data LIKE '" .$searchTheseArr[$i]. "'"; if($i!=count($searchTheseArr)-1){ $sql.=" OR"; } } } PHP: If I'm not clear show me where I should be more specific. Thanks!
$searchTheseArr = explode(" ", $searchTheseArr);//echo count sear chTheseArr); $sql="SELECT * FROM db_table WHERE 1=1 AND";for ($i=0; $i < count($searchTheseArr); $i++) { if(strlen($searchTheseArr[$i]) > 3){ $sql.=" text_data LIKE '" .$searchTheseArr[$i]. "'"; if($i!=count($searchTheseArr)-1){ $sql.=" OR"; } } } $result = mysql_query($sql); if(mysql_num_rows($result)> 3){ $row = mysql_fetch_array($result); for($x = 0;$x < count($row) -1;$x++){ echo $row[$x].'<br>'; } } PHP:
Number of rows in resulted reource $res = mysql_query(".............."); $num_rows = mysql_num_rows($res); I could not follow the second question. regards