I'm having a problem, I'm doing a site where I get the images from two different tables, but I can only call one what I should do, can someone please help me?
I'm having a problem, I'm doing a site where I get the images from two different tables, but I can only call one what I should do, can someone please help me?
You can do this as follows:
SELECT * FROM tabela1 as t1
LEFT JOIN tabela2 as t2 USING(id)
In this way, you get everything from the two tables, but you can also specify what you want to search for:
SELECT
t1.imagem,
t1.id,
t2.imagem,
t2.id
FROM tabela1 as t1
LEFT JOIN tabela2 as t2 USING(id)
In both cases, they would work fine. But it's a bit uncomfortable to come up with an exact answer, based only on texts, not specific information from your database.