usort(): The argument should be an array

-------------------------------1141138833
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Can anyone comment and fix this error
------------------------
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 which gives this error, the line highlighted in red
is the point where error is pointing,
------------------------------------------------------------ ----------

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

/**/

}

?>

-------------------------------1141138833--
Remember14a [ Di, 28 Februar 2006 16:00 ] [ ID #1208408 ]

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

T24gMjgvMDIvMDYsIFJlbWVtYmVyMTRhQGFvbC5jb20gPFJlbWVtYmVyMTRh QGFvbC5jb20+IHdy
b3RlOgo+IENhbiBhbnlvbmUgY29tbWVudCBhbmQgZml4IHRoaXMgZXJyb3IK PiAtLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0KPiBXYXJuaW5nOiB1c29ydCgpOiBUaGUgYXJndW1l bnQgc2hvdWxkIGJl
IGFuIGFycmF5IGluCj4gL2hvbWUyL3d3d2FiY2RlL3B1YmxpY19odG1sL3Nl YXJjaC9zZWFyY2hm
dW5jcy5waHAgb24gbGluZSAzMDAKClsuLi5dCgo+ICAgdXNvcnQoJHJlcywg ImNtcCIpOwoKUHV0
IGEgcHJpbnRfcigkcmVzKSBhYm92ZSB0aGlzIGxpbmUgYW5kIHNlZSB3aGF0 IHRoZSBjb250ZW50
cyBvZiAkcmVzCmFyZS4gV2hhdGV2ZXIgaXQgaXMsIGl0J3Mgbm90IGFuIGFy cmF5LiAgUHJvYmFi
bHkgYmVjYXVzZSB5b3VyIG15c3FsCnJlc3VsdCBzZXQgaXMgZW1wdHkgYW5k IHlvdSBmb3Jnb3Qg
dG8gaW5pdGlhbGlzZSAkcmVzIGJlZm9yZSB5b3UKbG9vcGVkIHRocm91Z2gg aXQgKGFzc3VtaW5n
IHRoZSBqdW5rIGFib3ZlIGlzIHRoZSB0YWlsIGVuZCBvZiBhIGxvb3ApLgoK ICAtcm9iaW4K
Robin Vickery [ Di, 28 Februar 2006 16:22 ] [ ID #1208411 ]

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

-------------------------------1141257438
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit



You have written,
Now do a var_dump($res) and see what *is* in $res
or do print_r().


Can you precisely mention where you want me to put this piece of code.

-------------------------------1141257438--
Remember14a [ Do, 02 März 2006 00:57 ] [ ID #1210389 ]

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

Remember14a [at] aol.com wrote:
>
> You have written,
> Now do a var_dump($res) and see what *is* in $res
> or do print_r().
>
>
> Can you precisely mention where you want me to put this piece of code.
>

Please include your original post so we can all see it so we don't have
to search to find what you're talking about - and highlighting doesn't
work because most people will get text-only emails.

............
$row[4];

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

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

$i++;

}

var_dump($res); <---------

usort($res, "cmp");


Then send us the output.

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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Chris [ Do, 02 März 2006 01:30 ] [ ID #1212153 ]

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

--part1_78.353203f.313797eb_boundary
Content-Type: multipart/alternative;
boundary="-----------------------------1141259755"


-------------------------------1141259755
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

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;

/**/

}

?>

-------------------------------1141259755
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META charset=3DUS-ASCII http-equiv=3DContent-Type content=3D"text/html; cha=
rset=3DUS-ASCII">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; BACKGROUND-COLOR: #fffff=
f">
<DIV>let me give you more details to understand problem with the said code.<=
/DIV>
<DIV> </DIV>
<DIV>go to this link, please.</DIV>
<DIV> </DIV>
<DIV><A title=3Dhttp://www.abcdefg.us/search/search.php href=3D"http://www.a=
bcdefg.us/search/search.php">http://www.abcdefg.us/search/se arch.php</A></DI=
V>
<DIV> </DIV>
<DIV>in search enter, </DIV>
<DIV>Justice, you get response without an error.</DIV>
<DIV> </DIV>
<DIV>Now enter law,</DIV>
<DIV> </DIV>
<DIV>you get error, pasted below,</DIV>
<DIV><BR><B>Warning</B>: usort(): The argument should be an array in <B>/hom=
e2/wwwabcde/public_html/search/searchfuncs.php</B> on line <B>300</B></DIV>
<DIV><STRONG> ------------------------------------------------------------ ---=
---</STRONG></DIV>
<DIV>
<DIV>below is part of the code and few lines of code above and below th=
e error point, as the code is more tha 300 lies I had to paste tail  en=
d of code at the point of error.</DIV>
<DIV>  ------------------------------------------------------------ ----=
------</DIV>
<DIV> </DIV>
<DIV>$row[4];</DIV>
<DIV> </DIV>
<DIV>   $res[$i]['size'] =3D $row[5];</DIV>
<DIV> </DIV>
<DIV>   $res[$i]['weight'] =3D $result_array[$row[0]];</DIV>
<DIV> </DIV>
<DIV>   $i++;</DIV>
<DIV> </DIV>
<DIV>  }</DIV>
<DIV><FONT color=3D#ff8040>  usort($res, "cmp");</FONT> </DIV>
<DIV> </DIV>
<DIV>  echo mysql_error();</DIV>
<DIV> </DIV>
<DIV>  $res['maxweight'] =3D $maxweight;</DIV>
<DIV> </DIV>
<DIV>  $res['results'] =3D $results;</DIV>
<DIV> </DIV>
<DIV>  return $res;</DIV>
<DIV> </DIV>
<DIV> /**/</DIV>
<DIV> </DIV>
<DIV> }</DIV>
<DIV> </DIV>
<DIV>?></DIV></DIV></BODY></HTML>

-------------------------------1141259755--

--part1_78.353203f.313797eb_boundary
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <dmagick [at] gmail.com>
Received: from rly-yi04.mx.aol.com (rly-yi04.mail.aol.com [172.18.180.132]) by air-yi03.mail.aol.com (vx) with ESMTP id MAILINYI34-7c544063cc4100; Wed, 01 Mar 2006 19:31:23 -0500
Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.194]) by rly-yi04.mx.aol.com (vx) with ESMTP id MAILRELAYINYI43-7c544063cc4100; Wed, 01 Mar 2006 19:31:00 -0500
Received: by zproxy.gmail.com with SMTP id k1so289955nzf
for <Remember14a [at] aol.com>; Wed, 01 Mar 2006 16:31:00 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:user-agent:x-accept-language :mime-version:to:cc:subject:references:in-reply-to:content-t ype:content-transfer-encoding;
b=hpBCEzAxhmfllCKkBnzJuuNbGz1omgGBAvF203tqOlgPjmpQWvAjGBWV6H xImOvHgtO0GrWIZ6PIFJRGZ6rcoOO91aqc91o/yx6YRaEtrpWckZxvV+38kp Pa5Zcq2z41eoKitIFianN95K7kbT+QU3QN7y3/NuxwTjjfxyC/1N4=
Received: by 10.36.103.18 with SMTP id a18mr987899nzc;
Wed, 01 Mar 2006 16:31:00 -0800 (PST)
Received: from ?10.1.1.22? ( [203.217.18.65])
by mx.gmail.com with ESMTP id r15sm855002nza.2006.03.01.16.30.58;
Wed, 01 Mar 2006 16:30:59 -0800 (PST)
Message-ID: <44063CC0.4020904 [at] gmail.com>
Date: Thu, 02 Mar 2006 11:30:56 +1100
From: Chris <dmagick [at] gmail.com>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Remember14a [at] aol.com
CC: php-general [at] lists.php.net
Subject: Re: [PHP] Re: usort(): The argument should be an array
References: <2d5.3c1a657.31378edf [at] aol.com>
In-Reply-To: <2d5.3c1a657.31378edf [at] aol.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-AOL-IP: 64.233.162.194
X-Mailer: Unknown (No Version)

Remember14a [at] aol.com wrote:
>
> You have written,
> Now do a var_dump($res) and see what *is* in $res
> or do print_r().
>
>
> Can you precisely mention where you want me to put this piece of code.
>

Please include your original post so we can all see it so we don't have
to search to find what you're talking about - and highlighting doesn't
work because most people will get text-only emails.

............
$row[4];

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

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

$i++;

}

var_dump($res); <---------

usort($res, "cmp");


Then send us the output.

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


--part1_78.353203f.313797eb_boundary
Content-Type: text/plain; charset=us-ascii

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--part1_78.353203f.313797eb_boundary--
Remember14a [ Do, 02 März 2006 01:35 ] [ ID #1212157 ]

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

Remember14a [at] aol.com 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
Chris [ Do, 02 März 2006 01:43 ] [ ID #1212159 ]

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

--part1_22d.7427268.31379b93_boundary
Content-Type: multipart/alternative;
boundary="-----------------------------1141260691"


-------------------------------1141260691
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

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

-------------------------------1141260691
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META charset=3DUS-ASCII http-equiv=3DContent-Type content=3D"text/html; cha=
rset=3DUS-ASCII">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; BACKGROUND-COLOR: #fffff=
f">
<DIV>I have done as per your instructions, and put</DIV>
<DIV> </DIV>
<DIV>var_dump($res);<BR><BR>BEFORE<BR><BR>usort($res, "cmp");</DIV>
<DIV> </DIV>
<DIV>Please, go again to </DIV>
<DIV><A href=3D"http://www.abcdefg.us/search/search.php">http://www.abcdefg.=
us/search/search.php</A></DIV>
<DIV> </DIV>
<DIV>Enter law we get this output.</DIV>
<DIV> </DIV>
<DIV>NULL <BR><B>Warning</B>: usort(): The argument should be an array in <B=
>/home2/wwwabcde/public_html/search/searchfuncs.php</B> on line <B>301</B></=
DIV></BODY></HTML>

-------------------------------1141260691--

--part1_22d.7427268.31379b93_boundary
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <php-general-return-231301-remember14a=aol.com [at] lists.php.net>
Received: from rly-xb02.mx.aol.com (rly-xb02.mail.aol.com [172.20.64.48]) by air-xb03.mail.aol.com (vx) with ESMTP id MAILINXB31-94440640551b9; Wed, 01 Mar 2006 19:46:34 -0500
Received: from lists.php.net (lists.php.net [216.92.131.4]) by rly-xb02.mx.aol.com (vx) with ESMTP id MAILRELAYINXB28-94440640551b9; Wed, 01 Mar 2006 19:46:13 -0500
X-Host-Fingerprint: 216.92.131.4 lists.php.net
Received: from ([216.92.131.4:20331] helo=lists.php.net)
by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP
id A3/4D-37756-55046044 for <remember14a [at] aol.com>; Wed, 01 Mar 2006 19:46:13 -0500
Received: (qmail 60403 invoked by uid 1010); 2 Mar 2006 00:43:58 -0000
Mailing-List: contact php-general-help [at] lists.php.net; run by ezmlm
Precedence: bulk
list-help: <mailto:php-general-help [at] lists.php.net>
list-unsubscribe: <mailto:php-general-unsubscribe [at] lists.php.net>
list-post: <mailto:php-general [at] lists.php.net>
Delivered-To: mailing list php-general [at] lists.php.net
Received: (qmail 60395 invoked by uid 1010); 2 Mar 2006 00:43:58 -0000
Delivered-To: ezmlm-scan-php-general [at] lists.php.net
Delivered-To: ezmlm-php-general [at] lists.php.net
X-Host-Fingerprint: 64.233.162.206 zproxy.gmail.com Linux 2.4/2.6
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:user-agent:x-accept-language :mime-version:to:cc:subject:references:in-reply-to:content-t ype:content-transfer-encoding;
b=lvmpDbrF3BuK6YawKgREU8dsdQIP2t0oizxuuifgdEr20diCB6GRx2ZbUV FVgKtmNY/rvypHKbke/aNXaKpUVKZF3IKYATt+FH61z91YncCzFbncCE0sG3 TIiet0viLstlnda29OD6BKZgsX6Ot9aP0PK7MKNOziGrUSUmPXHB0=
Message-ID: <44063FC6.6030901 [at] gmail.com>
Date: Thu, 02 Mar 2006 11:43:50 +1100
From: Chris <dmagick [at] gmail.com>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Remember14a [at] aol.com
CC: php-general [at] lists.php.net
References: <78.353203f.313797eb [at] aol.com>
In-Reply-To: <78.353203f.313797eb [at] aol.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: Fwd: [PHP] Re: usort(): The argument should be an array
X-AOL-IP: 216.92.131.4
X-Mailer: Unknown (No Version)

Remember14a [at] aol.com 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



--part1_22d.7427268.31379b93_boundary
Content-Type: text/plain; charset=us-ascii

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--part1_22d.7427268.31379b93_boundary--
Remember14a [ Do, 02 März 2006 01:51 ] [ ID #1212161 ]

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

Remember14a [at] aol.com 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/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Chris [ Do, 02 März 2006 02:01 ] [ ID #1212162 ]

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

--part1_66.68c794ef.3137a2c4_boundary
Content-Type: multipart/alternative;
boundary="-----------------------------1141262532"


-------------------------------1141262532
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

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.

-------------------------------1141262532
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META charset=3DUS-ASCII http-equiv=3DContent-Type content=3D"text/html; cha=
rset=3DUS-ASCII">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; BACKGROUND-COLOR: #fffff=
f">
<DIV><STRONG>If I put this </STRONG>code</DIV>
<DIV> </DIV>
<DIV>$res =3D array();<BR><BR>while($row =3D mysql_fetch_assoc($query_result=
)) {</DIV>
<DIV> </DIV>
<DIV>before </DIV>
<DIV> </DIV>
<DIV>usort($res, "cmp"); give this error</DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG>Parse error</STRONG>: parse error, unexpected $ in <B>/home2/ww=
wabcde/public_html/search/searchfuncs.php</B> on line <B>316</B></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG>even </STRONG> putting this code before</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>$res[$i]['size'] =3D $row[5];<BR><BR>    $res[$i]['weight'] =
=3D $result_array[$row[0]];<BR><BR>    $i++;<BR>}<BR><BR>usort($re=
s, "cmp");<BR><BR>gives same error.</DIV>
<DIV><BR></DIV></BODY></HTML>

-------------------------------1141262532--

--part1_66.68c794ef.3137a2c4_boundary
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <dmagick [at] gmail.com>
Received: from rly-xm05.mx.aol.com (rly-xm05.mail.aol.com [172.20.83.106]) by air-xm03.mail.aol.com (vx) with ESMTP id MAILINXM32-617440643d028e; Wed, 01 Mar 2006 20:01:23 -0500
Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.206]) by rly-xm05.mx.aol.com (vx) with ESMTP id MAILRELAYINXM59-617440643d028e; Wed, 01 Mar 2006 20:01:04 -0500
Received: by zproxy.gmail.com with SMTP id l1so292848nzf
for <Remember14a [at] aol.com>; Wed, 01 Mar 2006 17:01:04 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:user-agent:x-accept-language :mime-version:to:cc:subject:references:in-reply-to:content-t ype:content-transfer-encoding;
b=cxOtcmykf9T9ygxgkXCfNMEcDdmORi9DFOB/EhfF72VFSK+46uXe8BOoVV uH85DVtk7J0XIC65qdDrGYK20RKKFqvBoNlboPAlpqj6l9IUmEku4Q3LMHl3 JEYgmLoQrLzWp5SbakzVpaBZbiV7dJ5xBgV3wJhbfjRBcZPVoaLlc=
Received: by 10.36.220.25 with SMTP id s25mr1034888nzg;
Wed, 01 Mar 2006 17:01:03 -0800 (PST)
Received: from ?10.1.1.22? ( [203.217.18.65])
by mx.gmail.com with ESMTP id c12sm2118261nzc.2006.03.01.17.01.02;
Wed, 01 Mar 2006 17:01:03 -0800 (PST)
Message-ID: <440643CC.8090300 [at] gmail.com>
Date: Thu, 02 Mar 2006 12:01:00 +1100
From: Chris <dmagick [at] gmail.com>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Remember14a [at] aol.com
CC: php-general [at] lists.php.net
Subject: Re: Fwd: [PHP] Re: usort(): The argument should be an array
References: <22d.7427268.31379b93 [at] aol.com>
In-Reply-To: <22d.7427268.31379b93 [at] aol.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-AOL-IP: 64.233.162.206
X-Mailer: Unknown (No Version)

Remember14a [at] aol.com 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/


--part1_66.68c794ef.3137a2c4_boundary
Content-Type: text/plain; charset=us-ascii

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--part1_66.68c794ef.3137a2c4_boundary--
Remember14a [ Do, 02 März 2006 02:22 ] [ ID #1212163 ]

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

Remember14a [at] aol.com 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
Chris [ Do, 02 März 2006 02:26 ] [ ID #1212164 ]

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

--part1_ee.2643abdd.3137bfd1_boundary
Content-Type: multipart/alternative;
boundary="-----------------------------1141269968"


-------------------------------1141269968
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit



Below is the detailed code
and error this is giving,

Warning: usort(): The argument should be an array in
/home2/wwwabcde/public_html/search/searchfuncs.php on line 311
------------------------------------------------------------ ---
Once I enter for example,law at

http://www.abcdefg.us/search/search.php
------------------------------------------------------------ -----

Let me know precisely where to enter, $res = array();




------------------------------------------------------------ -----

error_reporting(E_ALL ^ E_NOTICE);
$include_dir = "include";
include "$include_dir/commonfuncs.php";


function cmp($a, $b) {
if ($a['weight'] == $b['weight'])
return 0;

return ($a['weight'] > $b['weight']) ? -1 : 1;
}

function addmarks($a) {
$a = eregi_replace("[ ]+", " ", $a);
$a = str_replace(" +", "+", $a);
$a = str_replace(" ", "+", $a);
return $a;
}

function makeboollist($a) {
global $entities;
while ($char = each($entities)) {
$a = eregi_replace($char[0], $char[1], $a);
}
$a = trim($a);
$a = eregi_replace(""", "\"", $a);
$returnWords = array();
//get all phrases
$regs = Array();
while (eregi("([-]?)\"([^\"]+)\"", $a, $regs)) {
if ($regs[1] == '') {
$returnWords['+s'][] = $regs[2];
$returnWords['hilight'][] = $regs[2];
} else {
$returnWords['-s'][] = $regs[2];
}
$a = str_replace($regs[0], "", $a);
}
$a = strtolower(eregi_replace("[ ]+", " ", $a));
// $a = remove_accents($a);
$a = trim($a);
$words = explode(' ', $a);
if ($a=="") {
$limit = 0;
} else {
$limit = count($words);
}


$k = 0;
//get all words (both include and exlude)
$includeWords = array();
while ($k < $limit) {
if (substr($words[$k], 0, 1) == '+') {
$includeWords[] = substr($words[$k], 1);
} else if (substr($words[$k], 0, 1) == '-') {
$returnWords['-'][] = substr($words[$k], 1);
} else {
$includeWords[] = $words[$k];
$returnWords['hilight'][] = $words[$k];
}
$k++;
}
//add words from phrases to includes
if (isset($returnWords['+s'])) {
foreach ($returnWords['+s'] as $phrase) {
$phrase = strtolower(eregi_replace("[ ]+", " ", $phrase));
$phrase = trim($phrase);
$temparr = explode(' ', $phrase);
foreach ($temparr as $w)
$includeWords[] = $w;
}
}

foreach ($includeWords as $word) {
if (!($word =='')) {
if (ignoreWord($word)) {

$returnWords['ignore'][] = $word;
} else {
$returnWords['+'][] = $word;
}
}

}

return $returnWords;
}

function ignoreword($word) {
global $common;
global $min_word_length;
global $index_numbers;
if ($index_numbers == 1) {
$pattern = "[a-z0-9]+";
} else {
$pattern = "[a-z]+";
}
if (strlen($word) < $min_word_length || (!eregi($pattern,
remove_accents($word))) || ($common[$word] == 1)) {
return 1;
} else {
return 0;
}
}

function search($searchstr, $category, $start, $per_page, $type) {
global $length_of_link_desc,$mysql_table_prefix, $show_meta_description;

//find all sites that should not be included in the result
if (count($searchstr['+']) == 0) {
return null;
}
$wordarray = $searchstr['-'];
$notlist = array();
$not_words = 0;
while ($not_words < count($wordarray)) {
$searchword = addslashes($wordarray[$not_words]);

$query1 = "SELECT link_id from ".$mysql_table_prefix."link_keyword,
".$mysql_table_prefix."keywords where
".$mysql_table_prefix."link_keyword.keyword_id= ".$mysql_table_prefix."keywords.keyword_id and keyword='$searchword'";
echo mysql_error();
$result = mysql_query($query1);

while ($row = mysql_fetch_row($result)) {
$notlist[$not_words]['id'][$row[0]] = 1;
}
$not_words++;
}


//find all sites containing the search phrase
$wordarray = $searchstr['+s'];
$phrase_words = 0;
while ($phrase_words < count($wordarray)) {
$searchword = addslashes($wordarray[$phrase_words]);
$query1 = "SELECT link_id from ".$mysql_table_prefix."links where fulltxt
like '% $searchword%'";
echo mysql_error();
$result = mysql_query($query1);
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
return null;
}
while ($row = mysql_fetch_row($result)) {
$phraselist[$phrase_words]['id'][$row[0]] = 1;
}
$phrase_words++;
}


if ($category> 0) {
$allcats = get_cats($category);
$catlist = implode(",", $allcats);
$query1 = "select link_id from ".$mysql_table_prefix."links,
".$mysql_table_prefix."sites, ".$mysql_table_prefix."categories,
".$mysql_table_prefix."site_category where ".$mysql_table_prefix."links.site_id =
".$mysql_table_prefix."sites.site_id and ".$mysql_table_prefix."sites.site_id =
".$mysql_table_prefix."site_category.site_id and ".$mysql_table_prefix."site_category.category_id
in ($catlist)";
$result = mysql_query($query1);
echo mysql_error();
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
return null;
}
while ($row = mysql_fetch_row($result)) {
$category_list[$row[0]] = 1;
}
}

//find all sites that include the search word
$wordarray = $searchstr['+'];
$words = 0;
$starttime = getmicrotime();
while ($words < count($wordarray)) {
$searchword = addslashes($wordarray[$words]);
$query1 = "SELECT distinct link_id, weight from
".$mysql_table_prefix."link_keyword, ".$mysql_table_prefix."keywords where
".$mysql_table_prefix."link_keyword.keyword_id= ".$mysql_table_prefix."keywords.keyword_id and
keyword='$searchword' order by weight desc";
$result = mysql_query($query1);
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
return null;
}
if ($type == "or") {
$indx = 0;
} else {
$indx = $words;
}

while ($row = mysql_fetch_row($result)) {
$linklist[$indx]['id'][] = $row[0];
$linklist[$indx]['weight'][$row[0]] = $row[1]; }
$words++;
}

if ($type == "or") {
$words = 1;
}
$result_array = Array();


if ($words == 1 && $not_words == 0 && $category < 1) { //if there is only
one search word, we already have the result
$result_array = $linklist[0]['weight'];
} else { //otherwise build an intersection of all the results
$j= 1;
$min = 0;
while ($j < $words) {
if (count($linklist[$min]['id']) > count($linklist[$j]['id'])) {
$min = $j;
}
$j++;
}

$j = 0;


$temp_array = $linklist[$min]['id'];
$count = 0;
while ($j < count($temp_array)) {
$k = 0; //and word counter
$n = 0; //not word counter
$o = 0; //phrase word counter
$weight = 1;
$break = 0;
while ($k < $words && $break== 0) {
if ($linklist[$k]['weight'][$temp_array[$j]] > 0) {
$weight = $weight + $linklist[$k]['weight'][$temp_array[$j]];
} else {
$break = 1;
}
$k++;
}
while ($n < $not_words && $break== 0) {
if ($notlist[$n]['id'][$temp_array[$j]] > 0) {
$break = 1;
}
$n++;
}

while ($o < $phrase_words && $break== 0) {
if ($phraselist[$n]['id'][$temp_array[$j]] != 1) {
$break = 1;
}
$o++;
}
if ($break== 0 && $category > 0 && $category_list[$temp_array[$j]] != 1) {
$break = 1;
}

if ($break == 0) {
$result_array[$temp_array[$j]] = $weight;
$count ++;
}
$j++;
}
}//word == 1

$end = getmicrotime()- $starttime;

$results = count($result_array);
if ($results == 0) {
return null;
}
arsort ($result_array);


$keys = array_keys($result_array);
$maxweight = $result_array[$keys[0]];

for ($i = ($start -1)*$per_page; $i <min($results, ($start -1)*$per_page +
$per_page) ; $i++) {
$in[] = $keys[$i];

}


if (!is_array($in)) {
$res['results'] = $results;
return $res;
}

$inlist = implode(",", $in);


if ($length_of_link_desc == 0) {
$fulltxt = "fulltxt";
} else {
$fulltxt = "substring(fulltxt, 1, $length_of_link_desc)";
}

$query1 = "SELECT distinct link_id, url, title, description, $fulltxt,
size FROM ".$mysql_table_prefix."links WHERE link_id in ($inlist)";
$result = mysql_query($query1);
echo mysql_error();


$i = 0;
while ($row = mysql_fetch_row($result)) {
$res[$i]['title'] = $row[2];
$res[$i]['url'] = $row[1];
if ($row[3] != null && $show_meta_description == 1)
$res[$i]['fulltxt'] = $row[3];
else
$res[$i]['fulltxt'] = $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;
/**/
}
?>

-------------------------------1141269968
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META charset=3DUS-ASCII http-equiv=3DContent-Type content=3D"text/html; cha=
rset=3DUS-ASCII">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; BACKGROUND-COLOR: #fffff=
f">
<DIV> </DIV>
<DIV> </DIV>
<DIV>Below is the detailed code</DIV>
<DIV>and error this is giving,</DIV>
<DIV> </DIV>
<DIV><STRONG>Warning</STRONG>: usort(): The argument should be an array in <=
B>/home2/wwwabcde/public_html/search/searchfuncs.php</B> on line <B>311</B><=
/DIV>
<DIV><STRONG> ------------------------------------------------------------ ---=
</STRONG></DIV>
<DIV><STRONG>Once I enter for example,law at</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG> <A href=3D"http://www.abcdefg.us/search/search.php">http:=
//www.abcdefg.us/search/search.php</A></STRONG></DIV>
<DIV> ------------------------------------------------------------ -----</DIV>
<DIV> </DIV>
<DIV>Let me know precisely where to enter, $res =3D array();  </DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> ------------------------------------------------------------ -----</DIV>
<DIV> </DIV>
<DIV>error_reporting(E_ALL ^ E_NOTICE);<BR>$include_dir =3D "include";<BR>in=
clude "$include_dir/commonfuncs.php";</DIV>
<DIV> </DIV>
<DIV><BR> function cmp($a, $b) {<BR>  if ($a['weight'] =3D=
=3D $b['weight'])<BR>   return 0;</DIV>
<DIV> </DIV>
<DIV>  return ($a['weight'] > $b['weight']) ? -1 : 1;<BR> =
}</DIV>
<DIV> </DIV>
<DIV> function addmarks($a) {<BR>  $a =3D eregi_replace("[ ]+=
", " ", $a);<BR>  $a =3D str_replace(" +", "+", $a);<BR> &nbs=
p;$a =3D str_replace(" ", "+", $a);<BR>  return $a;<BR> }</DI=
V>
<DIV> </DIV>
<DIV> function makeboollist($a) {<BR>  global $entities;<BR>&=
nbsp; while ($char =3D each($entities)) {<BR>   $a =3D e=
regi_replace($char[0], $char[1], $a);<BR>  }<BR>  $a =
=3D trim($a);<BR>  $a =3D eregi_replace("&quot;", "\"", $a);<B=
R>  $returnWords =3D array();<BR>  //get all phrases<BR>=
  $regs =3D Array();<BR>  while (eregi("([-]?)\"([^\"]+)=
\"", $a, $regs)) {<BR>   if ($regs[1] =3D=3D '') {<BR> &=
nbsp;  $returnWords['+s'][] =3D $regs[2];<BR>   &nb=
sp;$returnWords['hilight'][] =3D $regs[2];<BR>   } else {<BR>=
    $returnWords['-s'][] =3D $regs[2];<BR>  &n=
bsp;}<BR>   $a =3D str_replace($regs[0], "", $a);<BR> &n=
bsp;}<BR>  $a =3D strtolower(eregi_replace("[ ]+", " ", $a));<BR>/=
/  $a =3D remove_accents($a);<BR>  $a =3D trim($a);<BR>&=
nbsp; $words =3D explode(' ', $a);<BR>  if ($a=3D=3D"") {<BR>=
   $limit =3D 0;<BR>  } else {<BR>  $limi=
t =3D count($words);<BR>  }</DIV>
<DIV> </DIV>
<DIV><BR>  $k =3D 0;<BR>  //get all words (both include =
and exlude)<BR>  $includeWords =3D array();<BR>  while (=
$k < $limit) {<BR>   if (substr($words[$k], 0, 1) =3D=3D '=
+') {<BR>    $includeWords[] =3D substr($words[$k], 1);<=
BR>   } else if (substr($words[$k], 0, 1) =3D=3D '-') {<BR>&n=
bsp;   $returnWords['-'][] =3D substr($words[$k], 1);<BR>&nbs=
p;  } else {<BR>    $includeWords[] =3D $words=
[$k];<BR>    $returnWords['hilight'][] =3D  $words[=
$k];<BR>   }<BR>   $k++;<BR>  }<BR>&=
nbsp; //add words from phrases to includes<BR>  if (isset($re=
turnWords['+s'])) {<BR>   foreach ($returnWords['+s'] as $phr=
ase) {<BR>    $phrase =3D strtolower(eregi_replace("[ ]+=
", " ", $phrase));<BR>    $phrase =3D trim($phrase);<BR>=
    $temparr =3D explode(' ', $phrase);<BR>  &=
nbsp; foreach ($temparr as $w)<BR>     $includ=
eWords[] =3D $w;<BR>   }<BR>  }</DIV>
<DIV> </DIV>
<DIV>  foreach ($includeWords as $word) {<BR>   if =
(!($word =3D=3D'')) {<BR>    if (ignoreWord($word)) {</D=
IV>
<DIV> </DIV>
<DIV>     $returnWords['ignore'][] =3D $word;<BR>&n=
bsp;   } else {<BR>     $returnWords=
['+'][] =3D $word;<BR>    } <BR>   }=
</DIV>
<DIV> </DIV>
<DIV>  }</DIV>
<DIV> </DIV>
<DIV>  return $returnWords;<BR> }</DIV>
<DIV> </DIV>
<DIV> function ignoreword($word) {<BR>  global $common;<BR>&n=
bsp; global $min_word_length;<BR>  global $index_numbers;<BR>=
  if ($index_numbers =3D=3D 1) {<BR>   $pattern =
=3D "[a-z0-9]+";<BR>  } else {<BR>   $pattern =3D "=
[a-z]+";<BR>  }<BR>  if (strlen($word) < $min_word_le=
ngth || (!eregi($pattern, remove_accents($word))) || ($common[$word] =3D=3D =
1)) {<BR>   return 1;<BR>  } else {<BR>  =
 return 0;<BR>  }<BR> }</DIV>
<DIV> </DIV>
<DIV> function search($searchstr, $category, $start, $per_page, $type) =
{<BR>  global $length_of_link_desc,$mysql_table_prefix, $show_meta=
_description;</DIV>
<DIV> </DIV>
<DIV>  //find all sites that should not be included in the result<=
BR>  if (count($searchstr['+']) =3D=3D 0) {<BR>   r=
eturn null;<BR>  }<BR>  $wordarray =3D $searchstr['-'];<=
BR>  $notlist =3D array();<BR>  $not_words =3D 0;<BR>&nb=
sp; while ($not_words < count($wordarray)) {<BR>   $s=
earchword =3D addslashes($wordarray[$not_words]);</DIV>
<DIV> </DIV>
<DIV>   $query1 =3D "SELECT link_id from ".$mysql_table_prefi=
x."link_keyword, ".$mysql_table_prefix."keywords where ".$mysql_table_prefix=
.."link_keyword.keyword_id=3D ".$mysql_table_prefix."keywords.keyword_id and =
keyword=3D'$searchword'";<BR>   echo mysql_error();<BR> =
  $result =3D mysql_query($query1);</DIV>
<DIV> </DIV>
<DIV>   while ($row =3D mysql_fetch_row($result)) { <BR>=
    $notlist[$not_words]['id'][$row[0]] =3D 1;<BR> =
  }<BR>   $not_words++;<BR>  }<BR> &=
nbsp;</DIV>
<DIV> </DIV>
<DIV>  //find all sites containing the search phrase<BR> &nbs=
p;$wordarray =3D $searchstr['+s'];<BR>  $phrase_words =3D 0;<BR>&n=
bsp; while ($phrase_words < count($wordarray)) {<BR>  &nbs=
p;$searchword =3D addslashes($wordarray[$phrase_words]);<BR>  &nbs=
p;$query1 =3D "SELECT link_id from ".$mysql_table_prefix."links where fulltx=
t like '% $searchword%'";<BR>   echo mysql_error();<BR> =
  $result =3D mysql_query($query1);<BR>   $num_rows=
=3D mysql_num_rows($result);<BR>   if ($num_rows =3D=3D 0) {=
<BR>    return null;<BR>   }<BR> &nb=
sp; while ($row =3D mysql_fetch_row($result)) { <BR>  &n=
bsp; $phraselist[$phrase_words]['id'][$row[0]] =3D 1;<BR>  &n=
bsp;}<BR>   $phrase_words++;<BR>  }<BR>  =
</DIV>
<DIV> </DIV>
<DIV>  if ($category> 0) {<BR>   $allcats =3D ge=
t_cats($category);<BR>   $catlist =3D implode(",", $allcats);=
<BR>   $query1 =3D "select link_id from ".$mysql_table_prefix=
.."links, ".$mysql_table_prefix."sites, ".$mysql_table_prefix."categories, ".=
$mysql_table_prefix."site_category where ".$mysql_table_prefix."links.site_i=
d =3D ".$mysql_table_prefix."sites.site_id and ".$mysql_table_prefix."sites.=
site_id =3D ".$mysql_table_prefix."site_category.site_id and ".$mysql_table_=
prefix."site_category.category_id in ($catlist)";<BR>   $resu=
lt =3D mysql_query($query1);<BR>   echo mysql_error();<BR>&nb=
sp;  $num_rows =3D mysql_num_rows($result);<BR>   i=
f ($num_rows =3D=3D 0) {<BR>    return null;<BR> &n=
bsp; }<BR>   while ($row =3D mysql_fetch_row($result)) {=
 <BR>    $category_list[$row[0]] =3D 1;<BR> &n=
bsp; }<BR>  }</DIV>
<DIV> </DIV>
<DIV>  //find all sites that include the search word <BR>&nbs=
p; $wordarray =3D $searchstr['+'];<BR>  $words =3D 0;<BR>&nbs=
p; $starttime =3D getmicrotime();<BR>  while ($words < cou=
nt($wordarray)) {<BR>   $searchword =3D addslashes($wordarray=
[$words]);<BR>   $query1 =3D "SELECT distinct link_id, weight=
from ".$mysql_table_prefix."link_keyword, ".$mysql_table_prefix."keywords w=
here ".$mysql_table_prefix."link_keyword.keyword_id=3D ".$mysql_table_prefix=
.."keywords.keyword_id and keyword=3D'$searchword' order by weight desc";<BR>=
   $result =3D mysql_query($query1);<BR>   $nu=
m_rows =3D mysql_num_rows($result);<BR>   if ($num_rows =3D=
=3D 0) {<BR>    return null;<BR>   }<BR>&=
nbsp;  if ($type =3D=3D "or") {<BR>    $indx =
=3D 0;<BR>   } else {<BR>    $indx =3D $w=
ords;<BR>   }<BR>   <BR>   whil=
e ($row =3D mysql_fetch_row($result)) { <BR>    $li=
nklist[$indx]['id'][] =3D $row[0];<BR>    $linklist[$ind=
x]['weight'][$row[0]] =3D $row[1];    }<BR>   =
$words++;<BR>  }</DIV>
<DIV> </DIV>
<DIV>  if ($type =3D=3D "or") {<BR>   $words =3D 1;=
<BR>  }<BR>  $result_array =3D Array();<BR>   =
</DIV>
<DIV> </DIV>
<DIV>  if ($words =3D=3D 1 && $not_words =3D=3D 0 &&am=
p; $category < 1) { //if there is only one search word, we already have t=
he result<BR>   $result_array =3D $linklist[0]['weight'];<BR>=
  } else { //otherwise build an intersection of all the results<BR=
>   $j=3D 1;<BR>   $min =3D 0;<BR>  =
 while ($j < $words) {<BR>    if (count($linklis=
t[$min]['id']) > count($linklist[$j]['id'])) {<BR>    =
; $min =3D $j;<BR>    }<BR>    =
$j++;<BR>   }</DIV>
<DIV> </DIV>
<DIV>   $j =3D 0;</DIV>
<DIV> </DIV>
<DIV><BR>   $temp_array =3D $linklist[$min]['id'];<BR> &=
nbsp; $count =3D 0;<BR>   while ($j < count($temp_arr=
ay)) {<BR>    $k =3D 0; //and word counter<BR> &nbs=
p;  $n =3D 0; //not word counter<BR>    $o =
=3D 0; //phrase word counter<BR>    $weight =3D 1;<BR>&n=
bsp;   $break =3D 0;<BR>    while ($k <=
; $words && $break=3D=3D 0) {<BR>     if ($=
linklist[$k]['weight'][$temp_array[$j]] > 0) {<BR>    =
;  $weight =3D $weight + $linklist[$k]['weight'][$temp_array[$j]];=
<BR>     } else {<BR>     =
 $break =3D 1;<BR>     }<BR>   =
  $k++;<BR>    }<BR>    wh=
ile ($n < $not_words && $break=3D=3D 0) {<BR>   &n=
bsp; if ($notlist[$n]['id'][$temp_array[$j]] > 0) {<BR>  &=
nbsp;   $break =3D 1;<BR>     }<BR>&=
nbsp;    $n++;<BR>    }  &=
nbsp; </DIV>
<DIV> </DIV>
<DIV>    while ($o < $phrase_words && $break=
=3D=3D 0) {<BR>     if ($phraselist[$n]['id'][$temp=
_array[$j]] !=3D 1) {<BR>      $break =3D 1;<B=
R>     }<BR>     $o++;<BR>=
    }<BR>    if ($break=3D=3D 0 &=
;& $category > 0 && $category_list[$temp_array[$j]] !=3D 1) {=
<BR>     $break =3D 1;<BR>    }=
</DIV>
<DIV> </DIV>
<DIV>    if ($break =3D=3D 0) {<BR>   &nb=
sp; $result_array[$temp_array[$j]] =3D $weight;<BR>   &n=
bsp; $count ++;<BR>    }<BR>    =
;$j++;<BR>   }<BR>  }//word =3D=3D 1</DIV>
<DIV> </DIV>
<DIV>  $end =3D getmicrotime()- $starttime;</DIV>
<DIV> </DIV>
<DIV>  $results =3D count($result_array);<BR>  if ($resu=
lts =3D=3D 0) {<BR>   return null;<BR>  }<BR> =
 arsort ($result_array);</DIV>
<DIV> </DIV>
<DIV><BR>  $keys =3D array_keys($result_array);<BR>  $ma=
xweight =3D $result_array[$keys[0]];</DIV>
<DIV> </DIV>
<DIV>  for ($i =3D ($start -1)*$per_page; $i <min($results, ($s=
tart -1)*$per_page + $per_page) ; $i++) {<BR>   $in[] =3D $ke=
ys[$i];</DIV>
<DIV> </DIV>
<DIV>  }</DIV>
<DIV> </DIV>
<DIV><BR>  if (!is_array($in)) {<BR>   $res['result=
s'] =3D $results;<BR>   return $res;<BR>  }</DIV>
<DIV> </DIV>
<DIV>  $inlist =3D implode(",", $in);</DIV>
<DIV> </DIV>
<DIV><BR>  if ($length_of_link_desc =3D=3D 0) {<BR>  &nb=
sp;$fulltxt =3D "fulltxt";<BR>  } else {<BR>   $ful=
ltxt =3D "substring(fulltxt, 1, $length_of_link_desc)";<BR>  }</DI=
V>
<DIV> </DIV>
<DIV>  $query1 =3D "SELECT distinct link_id, url, title, descripti=
on,  $fulltxt, size FROM ".$mysql_table_prefix."links WHERE link_id in =
($inlist)";<BR>  $result =3D mysql_query($query1);<BR>  =
echo mysql_error();<BR>         =
;            &nb=
sp;            &=
nbsp;    </DIV>
<DIV> </DIV>
<DIV>  $i =3D 0;<BR>  while ($row =3D mysql_fetch_row($r=
esult)) {<BR>   $res[$i]['title'] =3D $row[2];<BR>  =
; $res[$i]['url'] =3D $row[1];<BR>   if ($row[3] !=3D nu=
ll && $show_meta_description =3D=3D 1)<BR>    $r=
es[$i]['fulltxt'] =3D $row[3];<BR>   else <BR>  &nb=
sp; $res[$i]['fulltxt'] =3D $row[4];</DIV>
<DIV> </DIV>
<DIV><BR>   $res[$i]['size'] =3D $row[5];<BR>  &nbs=
p;$res[$i]['weight'] =3D $result_array[$row[0]];<BR>   $i++;<=
BR>  }</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>            =
;            &nb=
sp;            &=
nbsp;   <BR>         =
            &nbs=
p;            &n=
bsp;      usort($res, "cmp"); <BR>   =
;            &nb=
sp;            &=
nbsp;            echo=
mysql_error();<BR>  $res['maxweight'] =3D $maxweight;<BR> &n=
bsp;$res['results'] =3D $results;<BR>  return $res;<BR> /**/<=
BR> }<BR>?><BR></DIV></BODY></HTML>

-------------------------------1141269968--

--part1_ee.2643abdd.3137bfd1_boundary
Content-Type: message/rfc822
Content-Disposition: inline

Return-path: <Remember14a [at] aol.com>
From: Remember14a [at] aol.com
Full-name: Remember14a
Message-ID: <78.353203f.313797eb [at] aol.com>
Date: Wed, 1 Mar 2006 19:35:55 EST
Subject: Fwd: [PHP] Re: usort(): The argument should be an array
To: php-general [at] lists.php.net
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="part2_ee.2643abdd.313797eb_boundary"
X-Mailer: 9.0 for Windows sub 5003


--part2_ee.2643abdd.313797eb_boundary
Content-Type: multipart/alternative;
boundary="-----------------------------1141259755"


-------------------------------1141259755
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

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;

/**/

}

?>

-------------------------------1141259755
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META charset=3DUS-ASCII http-equiv=3DContent-Type content=3D"text/html; cha=
rset=3DUS-ASCII">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; BACKGROUND-COLOR: #fffff=
f">
<DIV>let me give you more details to understand problem with the said code.<=
/DIV>
<DIV> </DIV>
<DIV>go to this link, please.</DIV>
<DIV> </DIV>
<DIV><A title=3Dhttp://www.abcdefg.us/search/search.php href=3D"http://www.a=
bcdefg.us/search/search.php">http://www.abcdefg.us/search/se arch.php</A></DI=
V>
<DIV> </DIV>
<DIV>in search enter, </DIV>
<DIV>Justice, you get response without an error.</DIV>
<DIV> </DIV>
<DIV>Now enter law,</DIV>
<DIV> </DIV>
<DIV>you get error, pasted below,</DIV>
<DIV><BR><B>Warning</B>: usort(): The argument should be an array in <B>/hom=
e2/wwwabcde/public_html/search/searchfuncs.php</B> on line <B>300</B></DIV>
<DIV><STRONG> ------------------------------------------------------------ ---=
---</STRONG></DIV>
<DIV>
<DIV>below is part of the code and few lines of code above and below th=
e error point, as the code is more tha 300 lies I had to paste tail  en=
d of code at the point of error.</DIV>
<DIV>  ------------------------------------------------------------ ----=
------</DIV>
<DIV> </DIV>
<DIV>$row[4];</DIV>
<DIV> </DIV>
<DIV>   $res[$i]['size'] =3D $row[5];</DIV>
<DIV> </DIV>
<DIV>   $res[$i]['weight'] =3D $result_array[$row[0]];</DIV>
<DIV> </DIV>
<DIV>   $i++;</DIV>
<DIV> </DIV>
<DIV>  }</DIV>
<DIV><FONT color=3D#ff8040>  usort($res, "cmp");</FONT> </DIV>
<DIV> </DIV>
<DIV>  echo mysql_error();</DIV>
<DIV> </DIV>
<DIV>  $res['maxweight'] =3D $maxweight;</DIV>
<DIV> </DIV>
<DIV>  $res['results'] =3D $results;</DIV>
<DIV> </DIV>
<DIV>  return $res;</DIV>
<DIV> </DIV>
<DIV> /**/</DIV>
<DIV> </DIV>
<DIV> }</DIV>
<DIV> </DIV>
<DIV>?></DIV></DIV></BODY></HTML>

-------------------------------1141259755--

--part2_ee.2643abdd.313797eb_boundary
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <dmagick [at] gmail.com>
Received: from rly-yi04.mx.aol.com (rly-yi04.mail.aol.com [172.18.180.132]) by air-yi03.mail.aol.com (vx) with ESMTP id MAILINYI34-7c544063cc4100; Wed, 01 Mar 2006 19:31:23 -0500
Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.194]) by rly-yi04.mx.aol.com (vx) with ESMTP id MAILRELAYINYI43-7c544063cc4100; Wed, 01 Mar 2006 19:31:00 -0500
Received: by zproxy.gmail.com with SMTP id k1so289955nzf
for <Remember14a [at] aol.com>; Wed, 01 Mar 2006 16:31:00 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:user-agent:x-accept-language :mime-version:to:cc:subject:references:in-reply-to:content-t ype:content-transfer-encoding;
b=hpBCEzAxhmfllCKkBnzJuuNbGz1omgGBAvF203tqOlgPjmpQWvAjGBWV6H xImOvHgtO0GrWIZ6PIFJRGZ6rcoOO91aqc91o/yx6YRaEtrpWckZxvV+38kp Pa5Zcq2z41eoKitIFianN95K7kbT+QU3QN7y3/NuxwTjjfxyC/1N4=
Received: by 10.36.103.18 with SMTP id a18mr987899nzc;
Wed, 01 Mar 2006 16:31:00 -0800 (PST)
Received: from ?10.1.1.22? ( [203.217.18.65])
by mx.gmail.com with ESMTP id r15sm855002nza.2006.03.01.16.30.58;
Wed, 01 Mar 2006 16:30:59 -0800 (PST)
Message-ID: <44063CC0.4020904 [at] gmail.com>
Date: Thu, 02 Mar 2006 11:30:56 +1100
From: Chris <dmagick [at] gmail.com>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Remember14a [at] aol.com
CC: php-general [at] lists.php.net
Subject: Re: [PHP] Re: usort(): The argument should be an array
References: <2d5.3c1a657.31378edf [at] aol.com>
In-Reply-To: <2d5.3c1a657.31378edf [at] aol.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-AOL-IP: 64.233.162.194
X-Mailer: Unknown (No Version)

Remember14a [at] aol.com wrote:
>
> You have written,
> Now do a var_dump($res) and see what *is* in $res
> or do print_r().
>
>
> Can you precisely mention where you want me to put this piece of code.
>

Please include your original post so we can all see it so we don't have
to search to find what you're talking about - and highlighting doesn't
work because most people will get text-only emails.

............
$row[4];

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

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

$i++;

}

var_dump($res); <---------

usort($res, "cmp");


Then send us the output.

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

--part2_ee.2643abdd.313797eb_boundary--


--part1_ee.2643abdd.3137bfd1_boundary
Content-Type: text/plain; charset=us-ascii

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--part1_ee.2643abdd.3137bfd1_boundary--
Remember14a [ Do, 02 März 2006 04:26 ] [ ID #1212170 ]

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

On Wed, 2006-03-01 at 22:26, Remember14a [at] aol.com wrote:
>

Is there a good reason for why you're clogging the mailing list with
your fancy shmancy HTML emails?

Cheers,
Rob.
--
..---------------------------------------------------------- --.
| InterJinn Application Framework - http://www.interjinn.com |
:----------------------------------------------------------- -:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`----------------------------------------------------------- -'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings [ Do, 02 März 2006 04:37 ] [ ID #1212171 ]

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

Remember14a [at] aol.com wrote:
>
>
> Below is the detailed code
> and error this is giving,
>
> *Warning*: usort(): The argument should be an array in
> */home2/wwwabcde/public_html/search/searchfuncs.php* on line *311*
> *----------------------------------------------------------- ----*
> *Once I enter for example,law at*
> **
> * http://www.abcdefg.us/search/search.php*
> ------------------------------------------------------------ -----
>
> Let me know precisely where to enter, $res = array();
> **
> **
<snip>

I guess you missed the part where I said post to pastebin and send us a
url?!

$i = 0;

$res = array(); <<<<<<====================

while ($row = mysql_fetch_row($result)) {
$res[$i]['title'] = $row[2];


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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Chris [ Do, 02 März 2006 04:35 ] [ ID #1212172 ]

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

Robert Cummings wrote:
> On Wed, 2006-03-01 at 22:26, Remember14a [at] aol.com wrote:
>
>>
>
>
> Is there a good reason for why you're clogging the mailing list with
> your fancy shmancy HTML emails?

he's trying to cut down on the ammount of reading I do ;-)

>
> Cheers,
> Rob.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jochem Maas [ Do, 02 März 2006 09:19 ] [ ID #1212178 ]

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

UmVtZW1iZXIxNGEgd3JvdGU6Cj4KPiAgICRpID0gMDsKPiAgIHdoaWxlICgk cm93ID0gbXlzcWxf
ZmV0Y2hfcm93KCRyZXN1bHQpKSB7Cj4gICAgJHJlc1skaV1bJ3RpdGxlJ10g PSAkcm93WzJdOwo+
ICAgICRyZXNbJGldWyd1cmwnXSA9ICRyb3dbMV07Cj4gICAgaWYgKCRyb3db M10gIT0gbnVsbCAm
JiAkc2hvd19tZXRhX2Rlc2NyaXB0aW9uID09IDEpCj4gICAgICRyZXNbJGld WydmdWxsdHh0J10g
PSAkcm93WzNdOwo+ICAgIGVsc2UKPiAgICAkcmVzWyRpXVsnZnVsbHR4dCdd ID0gJHJvd1s0XTsK
Pgo+Cj4gICAgJHJlc1skaV1bJ3NpemUnXSA9ICRyb3dbNV07Cj4gICAgJHJl c1skaV1bJ3dlaWdo
dCddID0gJHJlc3VsdF9hcnJheVskcm93WzBdXTsKPiAgICAkaSsrOwo+ICAg fQo+Cj4gIHVzb3J0
KCRyZXMsICJjbXAiKTsKClRoZSB2YXJfZHVtcCgkcmVzKSB3ZSBhc2tlZCB5 b3UgdG8gaW5zZXJ0
IG91dHB1dCAiTlVMTCIuIFRoYXQgbWVhbnMKdGhhdCAkcmVzIHdhcyB1bmRl ZmluZWQuCgokcmVz
IGlzIG9ubHkgZGVmaW5lZCB3aXRoaW4geW91ciBsb29wIGFuZCB5b3VyIGxv b3AgaXMgb25seSBl
eGVjdXRlZAppZiB0aGUgc2VhcmNoIGNvbWVzIGJhY2sgd2l0aCBhdCBsZWFz dCBvbmUgcmVzdWx0
LgoKU28gd2hhdCB5b3UgbmVlZCB0byBkbyBpcyBtYWtlIHN1cmUgdGhhdCAk cmVzIGlzIGFuIGFy
cmF5LCBldmVuIGlmCnRoZXJlIGFyZSBubyByZXN1bHRzIGZyb20geW91ciBx dWVyeS4gWW91IGRv
IHRoaXMgYnkgaW5pdGlhbGlzaW5nICRyZXMKdG8gYW4gYXJyYXkgYmVmb3Jl IHRoZSBsb29wLCBq
dXN0IGxpa2UgeW91J3ZlIGRvbmUgdG8gJGkuCgpBbGwgeW91IG5lZWQgdG8g ZG8gaXMgYWRkIG9u
ZSBsaW5lLCBqdXN0IGJlZm9yZSB0aGUgc3RhcnQgb2YgdGhlIGxvb3AgdGhh dCBzYXlzOgoKICAg
JHJlcyA9IGFycmF5KCk7Cgotcm9iaW4KCih0cnlpbmcgaGFyZCB0byByZW1h aW4gcGF0aWVudCkK
Robin Vickery [ Do, 02 März 2006 11:05 ] [ ID #1212180 ]

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

--part1_143.56eb74a9.313826d0_boundary
Content-Type: multipart/alternative;
boundary="-----------------------------1141296336"


-------------------------------1141296336
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit


I agree, $res = array();

needs to be declared. I tried this at various level in the code of 300 lines,
what happenes if error is suppresses, the search output is displayed in
different manner.I have posted full code at this link.Can you inform where
precisely I must include, so that neither error is displayed or search output is
displayed differetly.

$res = array(); in code posted at below link.

http://pastebin.com/579621

-------------------------------1141296336
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META charset=3DUS-ASCII http-equiv=3DContent-Type content=3D"text/html; cha=
rset=3DUS-ASCII">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR></HEAD>
<BODY style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; BACKGROUND-COLOR: #fffff=
f">
<DIV> </DIV>
<DIV>I agree,   $res =3D array();</DIV>
<DIV> </DIV>
<DIV>needs to be declared. I tried this at various level in the code of 300 =
lines, what happenes if error is suppresses, the search output is displayed =
in different manner.I have posted full code at this link.Can you inform wher=
e precisely I must include, so that neither error is displayed or searc=
h output is displayed differetly.</DIV>
<DIV> </DIV>
<DIV> $res =3D array(); in code posted at below link.</DIV>
<DIV> </DIV>
<DIV><A href=3D"http://pastebin.com/579621">http://pastebin.com/579621</A></=
DIV></BODY></HTML>

-------------------------------1141296336--

--part1_143.56eb74a9.313826d0_boundary
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <php-general-return-231322-remember14a=aol.com [at] lists.php.net>
Received: from rly-yc06.mail.aol.com (rly-yc06.mail.aol.com [172.18.205.149]) by air-yc03.mail.aol.com (vx) with ESMTP id MAILINYC32-6ee4406c3de211; Thu, 02 Mar 2006 05:07:38 -0500
Received: from lists.php.net (lists.php.net [216.92.131.4]) by rly-yc06.mail.aol.com (vx) with ESMTP id MAILRELAYINYC68-6ee4406c3de211; Thu, 02 Mar 2006 05:07:26 -0500
X-Host-Fingerprint: 216.92.131.4 lists.php.net
Received: from ([216.92.131.4:12342] helo=lists.php.net)
by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP
id 45/55-37756-ED3C6044 for <remember14a [at] aol.com>; Thu, 02 Mar 2006 05:07:26 -0500
Received: (qmail 54859 invoked by uid 1010); 2 Mar 2006 10:05:52 -0000
Mailing-List: contact php-general-help [at] lists.php.net; run by ezmlm
Precedence: bulk
list-help: <mailto:php-general-help [at] lists.php.net>
list-unsubscribe: <mailto:php-general-unsubscribe [at] lists.php.net>
list-post: <mailto:php-general [at] lists.php.net>
Delivered-To: mailing list php-general [at] lists.php.net
Received: (qmail 54851 invoked by uid 1010); 2 Mar 2006 10:05:52 -0000
Delivered-To: ezmlm-scan-php-general [at] lists.php.net
Delivered-To: ezmlm-php-general [at] lists.php.net
X-Host-Fingerprint: 64.233.182.203 nproxy.gmail.com Linux 2.4/2.6
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
s=beta; d=gmail.com;
h=received:message-id:date:from:to:subject:cc:in-reply-to:mi me-version:content-type:content-transfer-encoding:content-di sposition:references;
b=oV8PNWRzFzbXJyuURD4NBkTX9aWuitd7d5EDAd5vQIez5M3aaGgM1IM1Zo 9RFOpBaAVB9rctBN8QBxD7mdCZC3ZZrhB1icevoAkFE6a8HguNcCXsTKrfyK 3qmp1apjARf+doaZW/vPJt4i/AncDBqszTvthKw+bxaMzJ7ol9eJM=
Message-ID: <5cb2dafd0603020205t438ab5b9o [at] mail.gmail.com>
Date: Thu, 2 Mar 2006 10:05:47 +0000
From: "Robin Vickery" <robinv [at] gmail.com>
To: "Remember14a [at] aol.com" <Remember14a [at] aol.com>
Cc: php-general [at] lists.php.net
In-Reply-To: <ee.2643abdd.3137bfd1 [at] aol.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64
Content-Disposition: inline
References: <ee.2643abdd.3137bfd1 [at] aol.com>
Subject: Re: [PHP] Re: usort(): The argument should be an array
X-AOL-IP: 216.92.131.4
X-Mailer: Unknown (No Version)

UmVtZW1iZXIxNGEgd3JvdGU6Cj4KPiAgICRpID0gMDsKPiAgIHdoaWxlICgk cm93ID0gbXlz
cWxfZmV0Y2hfcm93KCRyZXN1bHQpKSB7Cj4gICAgJHJlc1skaV1bJ3RpdGxl J10gPSAkcm93
WzJdOwo+ICAgICRyZXNbJGldWyd1cmwnXSA9ICRyb3dbMV07Cj4gICAgaWYg KCRyb3dbM10g
IT0gbnVsbCAmJiAkc2hvd19tZXRhX2Rlc2NyaXB0aW9uID09IDEpCj4gICAg ICRyZXNbJGld
WydmdWxsdHh0J10gPSAkcm93WzNdOwo+ICAgIGVsc2UKPiAgICAkcmVzWyRp XVsnZnVsbHR4
dCddID0gJHJvd1s0XTsKPgo+Cj4gICAgJHJlc1skaV1bJ3NpemUnXSA9ICRy b3dbNV07Cj4g
ICAgJHJlc1skaV1bJ3dlaWdodCddID0gJHJlc3VsdF9hcnJheVskcm93WzBd XTsKPiAgICAk
aSsrOwo+ICAgfQo+Cj4gIHVzb3J0KCRyZXMsICJjbXAiKTsKClRoZSB2YXJf ZHVtcCgkcmVz
KSB3ZSBhc2tlZCB5b3UgdG8gaW5zZXJ0IG91dHB1dCAiTlVMTCIuIFRoYXQg bWVhbnMKdGhh
dCAkcmVzIHdhcyB1bmRlZmluZWQuCgokcmVzIGlzIG9ubHkgZGVmaW5lZCB3 aXRoaW4geW91
ciBsb29wIGFuZCB5b3VyIGxvb3AgaXMgb25seSBleGVjdXRlZAppZiB0aGUg c2VhcmNoIGNv
bWVzIGJhY2sgd2l0aCBhdCBsZWFzdCBvbmUgcmVzdWx0LgoKU28gd2hhdCB5 b3UgbmVlZCB0
byBkbyBpcyBtYWtlIHN1cmUgdGhhdCAkcmVzIGlzIGFuIGFycmF5LCBldmVu IGlmCnRoZXJl
IGFyZSBubyByZXN1bHRzIGZyb20geW91ciBxdWVyeS4gWW91IGRvIHRoaXMg YnkgaW5pdGlh
bGlzaW5nICRyZXMKdG8gYW4gYXJyYXkgYmVmb3JlIHRoZSBsb29wLCBqdXN0 IGxpa2UgeW91
J3ZlIGRvbmUgdG8gJGkuCgpBbGwgeW91IG5lZWQgdG8gZG8gaXMgYWRkIG9u ZSBsaW5lLCBq
dXN0IGJlZm9yZSB0aGUgc3RhcnQgb2YgdGhlIGxvb3AgdGhhdCBzYXlzOgoK ICAgJHJlcyA9
IGFycmF5KCk7Cgotcm9iaW4KCih0cnlpbmcgaGFyZCB0byByZW1haW4gcGF0 aWVudCkK


--part1_143.56eb74a9.313826d0_boundary
Content-Type: text/plain; charset=us-ascii

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--part1_143.56eb74a9.313826d0_boundary--
Remember14a [ Do, 02 März 2006 11:45 ] [ ID #1212181 ]

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

T24gMDIvMDMvMDYsIFJlbWVtYmVyMTRhQGFvbC5jb20gPFJlbWVtYmVyMTRh QGFvbC5jb20+IHdy
b3RlOgo+IENhbiB5b3UgaW5mb3JtIHdoZXJlIHByZWNpc2VseSBJIG11c3Qg aW5jbHVkZSwgc28g
dGhhdCBuZWl0aGVyIGVycm9yIGlzCj4gZGlzcGxheWVkIG9yIHNlYXJjaCBv dXRwdXQgaXMgZGlz
cGxheWVkIGRpZmZlcmV0bHkuCgpPaCwgSSBnaXZlIHVwLiBXaGVyZSdzIG15 IExpdHRsZSBCb29r
IG9mIENhbG0/Li4uCgogIC1yb2Jpbgo=
Robin Vickery [ Do, 02 März 2006 12:19 ] [ ID #1212182 ]
PHP » gmane.comp.php.general » usort(): The argument should be an array

Vorheriges Thema: How do I ...
Nächstes Thema: "Nested Set Model" or "modified preorder tree traversal"