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

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

 



Remember14a@xxxxxxx wrote:
*If I put this *code
$res = array();

while($row = mysql_fetch_assoc($query_result)) {
before usort($res, "cmp"); give this error ** ** *Parse error*: parse error, unexpected $ in */home2/wwwabcde/public_html/search/searchfuncs.php* on line *316* ** *even * putting this code before $res[$i]['size'] = $row[5];

    $res[$i]['weight'] = $result_array[$row[0]];

    $i++;
}

usort($res, "cmp");

gives same error.


You need to put

$res = array();

before you start looping over your mysql query results.

We didn't see all your code so we can't give you an *exact* line number or place to put it.

You need to adjust what you were told to fit into your code.


If you need more help, post your entire code block in http://www.pastebin.com and send us a url to look at.

--
Postgresql & php tutorials
http://www.designmagick.com/

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


[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