Re: Need help with arrays PLEASE!!!

From: Date: Wed, 09 Apr 2003 12:19:53 +0000
Subject: Re: Need help with arrays PLEASE!!!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-143056@lists.php.net to get a copy of this message
Bob, You are certainly welcome. I understand how confusing arrays can be as I have played with them quite a bit. It is very easy to over complicate any programming problem. I do it all to often. I usually find that a different perspective is usually the answer that I needed. Good luck with your scheduling. Regards, Jonathan Duncan -----Original Message----- From: Bob Strasser [mailto:bstrasser@telus.net] Sent: Wednesday, April 09, 2003 5:55 AM To: Jonathan Duncan Subject: Re: [PHP] Re: Need help with arrays PLEASE!!! Jonathan: Thank-you for this very insightful response. I've been working with PHP & MySQL for quite a while now and I never thought of that. What I am doing is trying to create a spreadsheet like array that will allow me to perform calculations on each cell based on specific formulas. I will use this array to setup scheduling in a production environment. After thinking about what you wrote for a few hours, I can see that I was really trying to do things the hard way. Thanx for the insight. Bob "Jonathan Duncan" <php@nacnud.com> wrote in message news:20030408225443.32974.qmail@pb1.pair.com... > Bob, > > Your $row variable is already a multidimensional array that holds all the > arrays. What more are you trying to do? > > Jonathan > > > "Bob Strasser" <bstrasser@telus.net> wrote in message > news:IOEJKJOCNENFMHGHJPPKMEBJCBAA.bstrasser@telus.net... > > I'mpulling multiple rows out of a MySQL database and inserting them into > > several arrays. After that I want to put all the arrays into one > > multi-dimensional array. Here is the code: > > > > while($row = mysql_fetch_row($mysql_result)) > > { > > $invoicenum[] = $row[0]; > > $name[] = $row[1]; > > $address[] = $row[2]; > > $city[] = $row[3]; > > $state[] = $row[4]; > > $zip[] = $row[5]; > > } > > > > I want to put $invoicenum[], $name[], $address[], $city[], $state[], > $zip[] > > into 1 multi-dimensional array. Can anyone help me with this? > > > >

« previous php.general (#143056) next »