convert Results into Associative array
I want to convert mysql results into associative array like below
But i want to get these results from my mysql result
function jobs() // previously i was using this function and i was declaring as mentioned in $job_arr
$job_arr = array(
' ' => "Please select job type",
' 3' =>"Freelancing"
$sql = "Select * from jh_job_type where Status = 1";
$query = $ci->db->query($sql);
$result = $query->result_array();
// Id,Name are the field names
$job_arr = ''; // i started doing with foreach but did not get required result.
Anyone know how to do this one?