let me give you more details to understand problem with the said code.
go to this link, please.
in search enter,
Justice, you get response without an error.
Now enter law,
you get error, pasted below,
Warning: usort(): The argument should be an array in /home2/wwwabcde/public_html/search/searchfuncs.php on line 300 ------------------------------------------------------------------
below is part of the code and few lines of code above and below the error point, as the code is more tha 300 lies I had to paste tail end of code at the point of error.
----------------------------------------------------------------------
$row[4];
$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
}
usort($res, "cmp");
echo mysql_error();
$res['maxweight'] = $maxweight;
$res['results'] = $results;
return $res;
/**/
}
?> |
--- Begin Message ---
- To: Remember14a@xxxxxxx
- Subject: Re: Re: usort(): The argument should be an array
- From: Chris <dmagick@xxxxxxxxx>
- Date: Thu, 02 Mar 2006 11:30:56 +1100
- Cc: php-general@xxxxxxxxxxxxx
- In-reply-to: <2d5.3c1a657.31378edf@xxxxxxx>
- References: <2d5.3c1a657.31378edf@xxxxxxx>
- User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
Remember14a@xxxxxxx wrote:You have written, Now do a var_dump($res) and see what *is* in $res or do print_r(). Can you precisely mention where you want me to put this piece of code.Please include your original post so we can all see it so we don't have to search to find what you're talking about - and highlighting doesn't work because most people will get text-only emails............ $row[4]; $res[$i]['size'] = $row[5]; $res[$i]['weight'] = $result_array[$row[0]]; $i++; } var_dump($res); <--------- usort($res, "cmp"); Then send us the output. -- Postgresql & php tutorials http://www.designmagick.com/
--- End Message ---
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php