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.

--- Begin Message ---
[EMAIL PROTECTED] wrote:
I have done as per your instructions, and put
var_dump($res);

BEFORE

usort($res, "cmp");
Please, go again to
http://www.abcdefg.us/search/search.php
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*


So you're not setting $res at all.

You should be doing:

# INITIALIZE RESULTS ARRAY HERE.
$res = array();

while($row = mysql_fetch_assoc($query_result)) {

..........................

   $res[$i]['size'] = $row[5];

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

   $i++;
}

usort($res, "cmp");

that will fix your problem (I know someone suggested this before too).

--
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

Reply via email to