P
P
Pavel Ivanov2014-09-30 13:02:16
PHP
Pavel Ivanov, 2014-09-30 13:02:16

How to merge in PHP associative arrays from two queries to the same table after UNION split?

Good afternoon.
I split one request into two. Made two queries to the database, got two results.
I need to combine query results into one associative array without rebuilding keys.
What is the best way to do this in PHP?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Senkevich, 2014-09-30
@paus

array_merge won't work?

P
Pavel Ivanov, 2014-10-01
@paus

Guys, thanks, it turned out that you can use UNION ALL in my case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question