I agree,   $res = array();
 
needs to be declared. I tried this at various level in the code of 300 lines, what happenes if error is suppresses, the search output is displayed in different manner.I have posted full code at this link.Can you inform where precisely I must include, so that neither error is displayed or search output is displayed differetly.
 
 $res = array(); in code posted at below link.
 
--- Begin Message ---
Remember14a wrote:
>
>   $i = 0;
>   while ($row = mysql_fetch_row($result)) {
>    $res[$i]['title'] = $row[2];
>    $res[$i]['url'] = $row[1];
>    if ($row[3] != null && $show_meta_description == 1)
>     $res[$i]['fulltxt'] = $row[3];
>    else
>    $res[$i]['fulltxt'] = $row[4];
>
>
>    $res[$i]['size'] = $row[5];
>    $res[$i]['weight'] = $result_array[$row[0]];
>    $i++;
>   }
>
>  usort($res, "cmp");

The var_dump($res) we asked you to insert output "NULL". That means
that $res was undefined.

$res is only defined within your loop and your loop is only executed
if the search comes back with at least one result.

So what you need to do is make sure that $res is an array, even if
there are no results from your query. You do this by initialising $res
to an array before the loop, just like you've done to $i.

All you need to do is add one line, just before the start of the loop that says:

   $res = array();

-robin

(trying hard to remain patient)

--- End Message ---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to