I could use a little help on a MySQL database issue I am dealing with. I have gone through a bunch of old answers to almost the same question, – but have had no luck sofar. Some of the answers seem like it is what I need (JOIN, INNER JOIN, JOIN LEFT), – but still doesnt give me the correct output. I got either a weird output or a plain error-message…
OK here goes:
I have 4 tables – and they all contain the same number of fields – with the same name. So 4 different tables with duplicate fields.
I need to fetch everything from all 4 tables where field eid=219, into one array, .
I need to be able to limit the output to 20 rows – so I can display them on separate pages. Which means the starting point will be different depending on current page…
Any idea how to go about this?
Lets say that the tables are:
table1
table2
table3
table4
And they all contain the fields:
id
eid
name
tekst
Thx
John
You need a UNION query: