
-- query to import data from excel to mysql for city table using state table's id
$sql = "INSERT into bf_city (`state_id`, `city_name`)
SELECT id AS state_id,  '$emapData[1]'
FROM bf_state
WHERE state_name = '$emapData[0]'";