How to display two different database tables in php

0

>     
asked by anonymous 09.08.2014 / 16:52

2 answers

1

You can use CROSS JOIN :

SELECT *
FROM tabela1
CROSS JOIN tabela2
    
09.08.2014 / 19:20
0

Hello, another idea is to use UNION, but the tables must have the same structure and the same amount of columns, eg:

SELECT *
FROM   table1
UNION ALL
SELECT *
FROM   table2

or

SELECT t1.id, t1.nome
FROM   table1 t1
UNION ALL
SELECT t2.id, t2.nome
FROM   table2 t2
    
11.08.2014 / 23:49