RE: [PHP] Multidimensional Arrays

2003-10-20 Thread Chris W. Parker
Ed Curtis on Monday, October 20, 2003 11:39 AM said: > What I'd like to do is break this into a multidimensional > array so I have approximately the following depending on what they > choose for each example. [snip] > I tried the following with no luck. > >

RE: [PHP] Multidimensional arrays

2003-07-18 Thread Ralph Guzman
x27;], 'name' => $oRsCusts['name'] ); } -- You now have your db results store in array $customers_array Hope this help. -Original Message- From: Gary Broughton [mailto:[EMAIL PROTECTED] Sent: Friday,

Re: [PHP] Multidimensional arrays

2003-07-18 Thread Curt Zirzow
Gary Broughton <[EMAIL PROTECTED]> wrote: > Hi > > Many thanks for your time Matt. I tried that method amongst a few > others, and couldn't seem to get it right. What I have eventually come > across is the function 'array-push' (bizarre!) to add a new array line > for each record (after it's bee

Re: [PHP] Multidimensional arrays

2003-07-18 Thread Gary Broughton
Hi Many thanks for your time Matt. I tried that method amongst a few others, and couldn't seem to get it right. What I have eventually come across is the function 'array-push' (bizarre!) to add a new array line for each record (after it's been initially defined). It seems to work for me, and ho

Re: [PHP] Multidimensional arrays

2003-07-18 Thread Matt Matijevich
select id, name from customer redim custarray(recordcount,2) i = 0 while not eof custarray(i,0) = id; custarray(i,1) = name; i = i+1; movenext wend Not sure what kind of db you are using but I put this together using postgresql using the manual. So this is untested. $conn = pg_c

Re: [PHP] Multidimensional arrays (more and more...)

2002-11-28 Thread Matt Vos
s[$fruit]['color']; $diameter = $fruits[$fruit]['diameter']; } Matt ----- Original Message - From: Mako Shark <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 28, 2002 3:45 PM Subject: Re: [PHP] Multidimensional arrays (more and more...) &g

Re: [PHP] Multidimensional arrays (more and more...)

2002-11-28 Thread Mako Shark
<> Yeah, I'd thought of that except there's no guarantee that it will be unique. Plus, it makes it harder to go through with a simple loop because $number really isn't guaranteed to be numeric (okay, so I have to change the name). Plus, it may not even start from 0, For instance, it doesn't have

Re: [PHP] Multidimensional arrays (more and more...)

2002-11-28 Thread Marek Kilimajer
if [$number] is unique, use it as the key: // $issue[]["number"] = "number"; -- removed $issue[$number]["headline"] = "headling"; $issue[$number]["writers"] = "writers"; $issue[$number]["list"] = "list"; $issue[$number]["senttosubscribers"] = "0"; $issue[$number]["month"] = "05"; $issue[$number]["

Re: [PHP] Multidimensional arrays

2002-08-19 Thread Rasmus Lerdorf
foreach($array as $i=>$values) { echo $values['id'],$values['name'] } On Mon, 19 Aug 2002, Richard Fox wrote: > Hi, > > Given the array $array initialized by: > > $query = "SELECT id,name FROM MYTABLE"; > $result = mysql_query($query); > $nrows = mysql_num_rows($result); >

RE: [PHP] Multidimensional arrays

2002-08-19 Thread Jay Blanchard
[snip] $query = "SELECT id,name FROM MYTABLE"; $result = mysql_query($query); $nrows = mysql_num_rows($result); for ($i=0; $i<$nrows; $i++) { $arr = mysql_fetch_array($result); $array[$i]['id'] = $arr['id']; $array[$i]['name'] = $arr['name'];

Re: [PHP] multidimensional arrays

2001-04-17 Thread Joe Stump
> $a[1][2][3][4][5] = "6"; > echo $a[1][2][3][4][5]; > > $b[][][][]= "7"; > echo $b[0][0][0][0]; > > I get '6' and '7'. Am I doing something wrong? This seems like PHP supports > arrays with > dimensions greater than 2. You just need to look at PHP's structure. It makes total sense when you t