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

[PHP] Multidimensional Arrays

2003-10-20 Thread Ed Curtis
I'm trying to submit multiple values to a variable within an tag by using a value such as value="this,that" There are multiple statements on this form each counting up from 1 using $count and $listings as such. This and That That and This On the recieving side I'

RE: [PHP] Multidimensional arrays

2003-07-18 Thread Ralph Guzman
July 18, 2003 8:49 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Multidimensional arrays 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 lin

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

[PHP] Multidimensional arrays

2003-07-18 Thread Gary Broughton
Hi Can anybody help me grasp multidimensional arrays please? Basically, I am retrieving all records from one table (two fields), and want to return them in an array. I am converting code from ASP to PHP, and in the former I did something like this: select id, name from customer redim custarray(r

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]["

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

2002-11-28 Thread Mako Shark
Wow. This goes way beyond simply printing multidimensional arrays. Here's some sample data: $issue[]["number"] = "number"; $issue[]["headline"] = "headling"; $issue[]["writers"] = "writers"; $issue[]["list"] = "list"; $issue[]["senttosubscribers"] = "0"; $issue[]["month"] = "05"; $issue[]["year"]

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'];

[PHP] Multidimensional arrays

2002-08-19 Thread Richard Fox
Hi, Given the array $array initialized by: $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'];

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

[PHP] multidimensional arrays

2001-04-17 Thread Michael Kimsal
Plutarck wrote: > PHP can be a tad screwy with how it handles multi-dimensional arrays, but > yes PHP handles them. No real speed problems with them either. > > But you may just want to use an associative array like: > > $loc = array("y" => $y, "x" => $x); > > Then just use $loc["y"] and $loc["