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

From: Date: Tue, 28 Feb 2006 16:25:14 +0000
Subject: Re: usort(): The argument should be an array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-231211@lists.php.net to get a copy of this message
$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; /**/ } ?> That's not enough, we need the part that sits above and in between the brace where $res gets filled.
You could also put mysql_error(); above the usort-statement. Is it possible that $res has once been the return-value of mysql_query() ? Don't forget to var_dump() your values _before_ the error can occur.

« previous php.general (#231211) next »