Re: combining 2 arrays
| From: | Ladislav Andel | Date: | Tue, 16 Oct 2007 16:23:32 +0000 |
| Subject: | Re: combining 2 arrays | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263240@lists.php.net to get a copy of this message | ||
Ladislav Andel wrote:
Miles Thompson wrote:Data at each database are mostly different.array_merge() function? If your db is MySQL, look at this thread, Google being your friend: http://lists.mysql.com/mysql/204616Thanks for quick reply. Array_merge doesn't do what I want. And also those databases are at different locations.. Not the same machines. I found something here http://www.linux.com/articles/52390 but not sure if it is what I want but will read up. This is not what I'm looking for either.. (replicating).
Thanks, LadaCheers - Milesx On 10/16/07, Ladislav Andel <ladaan@iptel.org> 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 array: (it's a sum of server names in table) 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 get result = array(array('8', 'SER'), array('9','Asterisk'), array('6','XIP')) Probably, it would be best to add number of Asterisk while cycling through data of second DB. The problem could be when databases have thousands of rows in each DB. I'm just asking in case you know a better approach. Thank you, Lada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php