, but haven't been able to get
anything to work.
TIA
- Original Message -
From: Weston Houghton [EMAIL PROTECTED]
To: Beauford.2002 [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Thursday, December 26, 2002 6:19 PM
Subject: Re: [PHP] Nested Arrays
Sure... for the longwinded
]
To: Beauford.2002 [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Thursday, December 26, 2002 6:19 PM
Subject: Re: [PHP] Nested Arrays
Sure... for the longwinded approach, just do this:
$row1 = array(col1, col2, col3, ...);
$row2 = array(col1, col2, col3, ...);
$row3 = array(col1, col2
: Friday, December 27, 2002 8:45 AM
Subject: Re: [PHP] Nested Arrays
Sorry, now I reminded myself this would cause a false element at the end
of $rows, use this:
while($tmp=mysql_fetch_array($res)) {
$rows[]=$tmp;
}
Marek Kilimajer wrote:
Simple:
while($rows[]=mysql_fetch_array
AM
Subject: Re: [PHP] Nested Arrays
Sorry, now I reminded myself this would cause a false element at the end
of $rows, use this:
while($tmp=mysql_fetch_array($res)) {
$rows[]=$tmp;
}
Marek Kilimajer wrote:
Simple:
while($rows[]=mysql_fetch_array($res)) {}
($res is a mysql result
this is a multidimensional array. I was trying something like $tmp[][]=???.
TIA
- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
Cc: Beauford.2002 [EMAIL PROTECTED]; PHP General
[EMAIL PROTECTED]
Sent: Friday, December 27, 2002 8:45 AM
Subject: Re: [PHP] Nested Arrays
Sorry, now I
PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Friday, December 27, 2002 11:41 AM
Subject: Re: [PHP] Nested Arrays
while($tmp=mysql_fetch_array($res)) { // now $tmp is now an array (as the
function name suggests)
$rows[]=$tmp; // by assigning to $rows[], we make $rows an array,
adding array
Hi,
Is there anyway to do a nested array, I have looked at the various array
functions and can't figure this out (if possible).
I want to be able to put each field of a row into an array, and then put
that entire row and into another array.
so when I display it, I would have:
row1 - col1
Sure... for the longwinded approach, just do this:
$row1 = array(col1, col2, col3, ...);
$row2 = array(col1, col2, col3, ...);
$row3 = array(col1, col2, col3, ...);
$row4 = array(col1, col2, col3, ...);
$row5 = array(col1, col2, col3, ...);
$main_array = array($row1, $row2, $row3, $row4,
Sure... for the longwinded approach, just do this:
$row1 = array(col1, col2, col3, ...);
$row2 = array(col1, col2, col3, ...);
$row3 = array(col1, col2, col3, ...);
$row4 = array(col1, col2, col3, ...);
$row5 = array(col1, col2, col3, ...);
$main_array = array($row1, $row2, $row3, $row4,
Is there anyway to do a nested array, I have looked at the various array
functions and can't figure this out (if possible).
Try reading up on multidimensional array...
http://www.onlamp.com/pub/a/php/2001/06/07/php_foundations.html
PROTECTED]
To: Beauford.2002 [EMAIL PROTECTED]
Cc: PHP General [EMAIL PROTECTED]
Sent: Thursday, December 26, 2002 6:19 PM
Subject: Re: [PHP] Nested Arrays
Sure... for the longwinded approach, just do this:
$row1 = array(col1, col2, col3, ...);
$row2 = array(col1, col2, col3, ...);
$row3
- Original Message -
From: Beauford.2002 [EMAIL PROTECTED]
To: Wee Keat [Amorphosium] [EMAIL PROTECTED]
Sent: Friday, December 27, 2002 12:13 PM
Subject: Re: [PHP] Nested Arrays
Quote: I have looked at the various array functions and can't figure this
out .
Wow... You're welcome
Subject: [PHP] Nested Arrays
Hi,
Is there anyway to do a nested array, I have looked at the various array
functions and can't figure this out (if possible).
I want to be able to put each field of a row into an array, and then
put
that entire row and into another array.
so when I display it, I
13 matches
Mail list logo