connect_error) { die("Connection failed: " . $conn->connect_error); } $city = 'Westminster'; $sql = "SELECT * FROM LocationContent lc INNER JOIN Locations l ON l.Id = lc.LocationId INNER JOIN ContentCategories cc ON cc.Id = lc.ContentCategoryId WHERE l.City = '" . $city . "' AND cc.Name = 'Bed Bug Control' LIMIT 0 , 1"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { $metaTitle = trim($row['MetaTitle']); $metaDescription = trim($row['MetaDescription']); $intro = trim($row['Intro']); $content = trim($row['Content']); $state = trim($row['State']); $stateAbbr = trim($row['StateAbbr']); $external = trim($row['External']); $lat = $row['Lat']; $long = $row['Long']; } } else { echo "0 results"; } ?>

close(); ?>