[PHP] combining 2 arrays

2007-10-16 Thread Ladislav Andel
Hi list! I read data from 2 databases and for the purpose of displaying the information at my web interface as one piece I need to combine the data into one array first.. Here is my problem: Firstly, it reads from first DB and get this array: (it's a sum of server names in table) arrayDB1 =

Re: [PHP] combining 2 arrays

2007-10-16 Thread Miles Thompson
array_merge() function? If your db is MySQL, look at this thread, Google being your friend: http://lists.mysql.com/mysql/204616 Cheers - Milesx On 10/16/07, Ladislav Andel [EMAIL PROTECTED] wrote: Hi list! I read data from 2 databases and for the purpose of displaying the information at my

Re: [PHP] combining 2 arrays

2007-10-16 Thread Ladislav Andel
Miles Thompson wrote: array_merge() function? If your db is MySQL, look at this thread, Google being your friend: http://lists.mysql.com/mysql/204616 Thanks for quick reply. Array_merge doesn't do what I want. And also those databases are at different locations.. Not the same machines. I

Re: [PHP] combining 2 arrays

2007-10-16 Thread Ladislav Andel
Ladislav Andel wrote: Miles Thompson wrote: array_merge() function? If your db is MySQL, look at this thread, Google being your friend: http://lists.mysql.com/mysql/204616 Thanks for quick reply. Array_merge doesn't do what I want. And also those databases are at different locations..

Re: [PHP] combining 2 arrays

2007-10-16 Thread Paul Scott
On Tue, 2007-10-16 at 16:42 +0200, Ladislav Andel wrote: arrayDB1 = array(array('8', 'SER'), array('5','Asterisk')) When finished then it starts reading from second DB where I would get arrayDB2 = array(array('6', 'XIP'), array('4','Asterisk')) Is there any function where I would

Re: [PHP] combining 2 arrays

2007-10-16 Thread Greg Donald
On Tue, 16 Oct 2007, Paul Scott wrote: You could try something like: $result[] = $arrayDB1; $result[] .= $arrayDB2; That .= doesn't do what you think it does when used with arrays. -- Greg Donald Cyberfusion Consulting http://cyberfusionconsulting.com/ -- PHP General Mailing List

Re: [PHP] combining 2 arrays

2007-10-16 Thread Philip Thompson
On 10/16/07, Greg Donald [EMAIL PROTECTED] wrote: On Tue, 16 Oct 2007, Paul Scott wrote: You could try something like: $result[] = $arrayDB1; $result[] .= $arrayDB2; That .= doesn't do what you think it does when used with arrays. Take this same concept (of creating a new array) and

Re: [PHP] combining 2 arrays

2007-10-16 Thread James Ausmus
On 10/16/07, Ladislav Andel [EMAIL PROTECTED] wrote: Hi list! I read data from 2 databases and for the purpose of displaying the information at my web interface as one piece I need to combine the data into one array first.. Here is my problem: Firstly, it reads from first DB and get this

Re: [PHP] combining 2 arrays

2007-10-16 Thread Ladislav Andel
nope, merge is not doing what I want and also using FEDERATED http://localhost/phpmyadmin/server_engines.php?engine=FEDERATEDtoken=d18a0e0de85e891b3558f84f6585994f engine in mysql I think is not the simplest way to go or even not appropriate. Anyhow, I did it an ugly way ( tablearray follows DB

Re: [PHP] combining 2 arrays

2007-10-16 Thread Ladislav Andel
Thank you very much! It's exactly the code I was looking for! Lada PS: my previous ungly code is half long now :) James Ausmus wrote: On 10/16/07, Ladislav Andel [EMAIL PROTECTED] wrote: Hi list! I read data from 2 databases and for the purpose of displaying the information at my web

RE: [PHP] combining 2 arrays

2007-10-16 Thread Daevid Vincent
-Original Message- From: Ladislav Andel [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 16, 2007 1:05 PM To: James Ausmus; PHP List Subject: Re: [PHP] combining 2 arrays Thank you very much! It's exactly the code I was looking for! Lada PS: my previous ungly code is half

Re: [PHP] combining 2 arrays

2007-10-16 Thread James Ausmus
Andel [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 16, 2007 1:05 PM To: James Ausmus; PHP List Subject: Re: [PHP] combining 2 arrays Thank you very much! It's exactly the code I was looking for! Lada PS: my previous ungly code is half long now :) James Ausmus wrote