This is my current statement without join
$s1 = "SELECT *
FROM states
WHERE
statecode='".intval($getStateCode)."'
";
$s2 = "SELECT *
FROM county
WHERE
statecode='".intval($getStateCode)."'
AND
countycode='".intval($getCountyCode)."'
";
$s3 = "SELECT *
FROM town
WHERE
statecode='".intval($getStateCode)."'
AND
countycode='".intval($getCountyCode)."'
AND
towncode='".intval($getTownCode)."'";
$s4 = "SELECT *
FROM villages
WHERE
statecode='".intval($getStateCode)."'
AND
countycode='".intval($getCountyCode)."'
AND
towncode='".intval($getTownCode)."'
AND
villagecode='".intval($getVillageCode)."'";
It’s possible to join all of my tables in one statement? Let me know.
1 Answer