0
I am here today to ask for the assistance of those who are more experienced in the matter than I am. I have a free query with codeigniter, that of the error in the execution, but when I run it in Workbenth goes right. I’m gonna drop the code and hope somebody can give me a hand.
protected $cms;
// Construção da classe pai
public function __construct(){
parent:: __construct();
$this->cms = $this->load->database('cms', TRUE);
}
// pega os atributos para exibir no carousel
function getCarousel(){
$this->cms->query('SELECT titulo.post_title, titulo.post_name, anexo.ID, anexo.guid
FROM
pt_posts anexo
inner join pt_posts titulo on titulo.ID = anexo.post_parent
WHERE
anexo.post_type = "attachment"
ORDER BY
ID
DESC LIMIT 4');
$query = $this->cms->get()->result();
if ($query) {
return $query;
}else{
return false;
}