I needed to check if the mytable
table, in the mycolumn
column, the value is 'meuvalor'
.
My controller:
public function GetValue()
{
$this->config->set_item('language', $this->session->errorMessagesLang);
$this->load->library('parser');
$name= $this->admin_model->getmycolumn();
if($name['mycolumn'] == 'meuvalor'){
//fazer o que eu quero
}
echo $result;}
My model:
public function getmycolumn()
{
$this->db->select('mycolumn');
$this->db->from('mytable');
$result = $this->db->get()->result();
return $result;
}
My problem is ifstatement, this is not being able to resolve my code, ie it does not check, I think it has to do with this:
$name['mycolumn'] == 'meuvalor'
It does not seem to be the right syntax.
All kinds of help are welcome! PS: I just want to make it clear that I can get the value from the table, I just want to check if it has the value inside it.