FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Roll SQL name value query into two-dimensional array
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Roll SQL name value query into two-dimensional array [message #175206 is a reply to message #175199] Mon, 22 August 2011 12:21 Go to previous message
Jonathan Stein is currently offline  Jonathan Stein
Messages: 43
Registered: September 2010
Karma:
Member
Den 22-08-2011 03:35, Richard A. DeVenezia wrote:

> want
> x[0] = array('a'=>1,'b'=>2,'c'=>3);
> x[1] = array('a'=>10,'b'=>9,'c'=>8);

Use g as the index for x:

while ($obj = db_fetch_object($result)) $x[$obj->g][$obj->n] = $obj->v;

If you want $x to be zero indexed, use:
$x = array_values($x);

Regards

Jonathan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: MySQL date time current time diffenece
Next Topic: different servers, different results with a file upload
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 18:41:06 GMT 2024

Total time taken to generate the page: 0.05135 seconds