[thelist] Populating arrays dynamically

Michael Pemberton mpember at phreaker.net
Tue Jun 4 08:56:01 CDT 2002


Ms N Saidova wrote:

>Hi there,
>
>Can someone tell me how I can, in PHP, populate
>multidimensional arrays dynamically with results from the
>database? (I used to do that in ASP with GetRows().)
>
>Here is the thing. I need data from tables lying in 2 separate
>databases, and because as far as I know you cannot connect to
>more than one database at a time, I thought I should get the
>results from the one database, populate a multidimensional array
>with those, close that connection, open a new one to the second
>database and do the rest of the query.
>
>Or am I taking the long route here?
>Any suggestions much appreciated.
>
>Nedret
>
>
>
Can you show some of your code?

There is definately a method of access two databases simultaniously.
The trick is to make sure that you are using the connection and result
pointers.  This is how you tell PHP which database / set of results to
work with.  I currently do the reverse and populate a 3d array from two
separate files and then create insert the results into a mysql database.

If you post me a sample offlist, I can try going into more detail.

--
Michael Pemberton
mpember at phreaker.net
ICQ: 12107010







More information about the thelist mailing list