Answer the question
In order to leave comments, you need to log in
How to select records and two more records to them in mysql?
There are 2 tables: sources and articles .
You need to select 4 entries from sources and 2 entries from articles for them .
I make 1 request at once:
And the second one in each iteration of the loop:SELECT * FROM sources ORDER BY id DESC LIMIT 4
SELECT * FROM articles WHERE source_id='$id' ORDER BY id DESC LIMIT 2
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question