Re: usort(): The argument should be an array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 28/02/06, Remember14a@xxxxxxx <Remember14a@xxxxxxx> wrote:>> No this doesnt solve error.> 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
Yeah, sure.
So you know $res *isn't* an array, which is why you're getting thewarning that  "The argument should be an array".
So you need to find out what *is* in $res, which is why I suggestedthe print_r().
Now do a var_dump($res) and see what *is* in $res. Then you'll have towork out *why* it's not an array - and the answer to that is somewherein those 300 lines of code you can't post.
The few lines at the end of the loop seem to be treating $res as anarray. But as it's *not* an array, either those lines aren't beingexecuted or you've initialised $res to something silly beforehand,like a string.
  -robin

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux