Select two tables at once

Asked

Viewed 34 times

-2

I got the city and neighborhood tablesinserir a descrição da imagem aqui

inserir a descrição da imagem aqui

How do I display the city and neighborhood it belongs to ? tried to use a INNER JOIN but it didn’t work ? in that inner join has a $_GET that should fetch the city id

$sql = "select bai.*, cid.cid_nome from bairro bai inner join cidade cid on (cid.cid_id = bai.cid_id) where bai.cid_id =  '" . $_GET["cid"] . "' and cid.cid_id = '" . $_GET["cid"] . "'";
  • 1

    It seems right, detail the "but it didn’t work" ...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.