php joins

hello
i got 4 tables and almost all columns of tables are same
these columns are same in all 4 tables
name,last_name,email,age,date

how can i get them all from 4 tables showed in one page and ordered by date?
i already looked for joins and material how to do this(https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/) but i still can’t understand how to do this, usually an example helps me to understand it better

please help…

You wouldn’t use a JOIN, you would use a UNION. Joins are for getting related data, i.e. data in table ‘b’ is related to table ‘a’ using a common id value.

However, you shouldn’t have same meaning data in separate tables. If the only thing that’s different between the tables is something like a category or status, you should have a single table holding all of the data and have a category/status column to hold the data that’s different.

Thank you dude really helped me out!

Why would you have 4 tables with the same data? That is a horrible design.

No ,you don’t use union. You properly normalize the database.

Sponsor our Newsletter | Privacy Policy | Terms of Service