MySQL Join Problem (PHP)

Solved
Hello, so I have 5 tables in my database and I need to display all 5 tables with a single query (SQL join), how can I do that? Please help me. Thank you.

1 answer

  1. Hello,

    The "union" function should solve your problem:

    SELECT last_name, first_name
    FROM Table1
    UNION
    SELECT last_name, first_name
    FROM Table2;

    Best regards
    Exileur
    --
    Don’t forget to mark your post as resolved when you have received answers to your questions...
    In the land of the blind, the one-eyed are kings.
    0
    1. Hello, thank you for your response. Is it mandatory to do it on several lines?
      0
    2. Vous pouvez le faire sur une seule ligne.
      0
    3. And don't forget to mark your post as resolved :)
      0
    4. Alright, thank you very much.
      0