Click to See Complete Forum and Search --> : no results found


sandro27
04-27-2005, 04:06 PM
Hi,

I would like to know how can make the script to seach the database and if "0" are found it just give no results found.

script bellow

<?
include "intro.php";

$area=$_POST['area'];
if($area==''){
$area=$_GET['area'];}

$category=$_POST['acc_category'];
if($category==''){
$category=$_GET['acc_category_id'];
}

$sql="select * from accommodation,area,acc_category where
area.area_id=accommodation.area and accommodation.category_id=acc_category.acc_category_id
and area='$area'
and acc_category_id='$category'
order by acc_name limit $from,$max_results";


$search=mysql_query($sql,$search) or die(mysql_error());
$list=mysql_fetch_array($search);
?>

Thanks for any help
:o

pyro
04-27-2005, 04:14 PM
Take a look at mysql_num_rows() (http://us2.php.net/manual/en/function.mysql-num-rows.php)

sandro27
04-27-2005, 09:29 PM
Hi Pyro,

It worked perfectly.

Thanks :)

pyro
04-27-2005, 10:00 PM
You bet. :)