I have done as per your instructions, and put
var_dump($res);
BEFORE usort($res, "cmp"); Please, go again to
Enter law we get this output.
NULL
Warning: usort(): The argument should be an array in /home2/wwwabcde/public_html/search/searchfuncs.php on line 301 |
--- Begin Message ---
- To: Remember14a@xxxxxxx
- Subject: Re: Fwd: Re: usort(): The argument should be an array
- From: Chris <dmagick@xxxxxxxxx>
- Date: Thu, 02 Mar 2006 11:43:50 +1100
- Cc: php-general@xxxxxxxxxxxxx
- In-reply-to: <78.353203f.313797eb@xxxxxxx>
- List-help: <mailto:php-general-help@lists.php.net>
- List-post: <mailto:php-general@lists.php.net>
- List-unsubscribe: <mailto:php-general-unsubscribe@lists.php.net>
- References: <78.353203f.313797eb@xxxxxxx>
- User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
Remember14a@xxxxxxx wrote:let me give you more details to understand problem with the said code.go to this link, please. http://www.abcdefg.us/search/search.php 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; /**/ } ?>I found the code and put it in my reply before. As everyone has already said, we need to know what "res" is. Put var_dump($res); BEFORE usort($res, "cmp"); -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php