php - CodeIgniter db->query returning false on SELECT -
this particular application has been in use on year now, , uses several dozen models, , having trouble 1 particular new function.
public function get_slides($promo = null) { $sql = "select description alt, image, link " . config_database . ".slides active = '1' , acct_no = '" . api_acct . "' order priority asc;"; $query = $this->db->query($sql); var_dump($sql); var_dump($query); return $query->result_array(); }
the results of are:
string 'select description alt, image, link web_config_development.slides active = '1' , acct_no = '10001' order priority asc;' (length=143) boolean false
followed by:
fatal error: call member function result_array() on non-object
the query works fine in mysql workbench. in searching issue have come across docs referring true/false responses on insert , delete, not on select.
this not make sense ... if have ideas, sharing them appreciated.
i believe calling wrong method result.
try this
return $query->result();
for more information about codeigniter active record go here
Comments
Post a Comment