Get where from Codeigniter return Unknown column -
Get where from Codeigniter return Unknown column -
im trying info based on status xml file, issue on request foreach status homecoming column value doesn't exist.
xml file:
<?xml version="1.0" encoding="utf-8"?> <country> <state city="newyork" available="1"/> <state city="newjersey" available="1"/> </country>
controller:
public function getidfromcity($city){ $this->db->select('entity_id'); $this->db->where('city', $city); $query = $this->db->get('cities'); homecoming $query->result_array(); } $count = 1; foreach ($xml->state $state){ $data = array(); $data[0] = $state->attributes()->city; $data[1] = $state->attributes()->available; if($this->getidfromcity($data[0])){ echo '<pre>'; print_r($this->getidfromcity($data[0])); } $count++; }
the question si, how can info cities database based in xml info status ?
the error is:
error number: 1054 unknown column 'newyork' in 'where clause' select `entity_id` (`cities`) `city` = newyork filename: codeigniter\system\database\db_driver.php line number: 330
repalce line
$this->db->where('city', $city);
with
$this->db->where('city', $city, true);
codeigniter
Comments
Post a Comment