Welcome Guest, Not a member yet? Register   Sign In
Database returns true or false?
#1

[eluser]Lazos[/eluser]
Code:
function insertPermsDB($pid, $gid) {
        $data = array (
            'permission_id' => $pid,
            'group_id'         => $gid,
            'create_date'    => mdate($this->datestring, $this->time),
            'modified_date'    => mdate($this->datestring, $this->time)
        );
        $this->db->insert('my_group_perms', $data);
    }

If I have this query for example can I return true or false or either the query will be executed and if not it will return a database error?
#2

[eluser]Velin[/eluser]
I'm not entirely sure I understand your question, but I think this is what you need:

Code:
if($this->db->insert('my_group_perms', $data))
     return true;
else
     return false;




Theme © iAndrew 2016 - Forum software by © MyBB