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

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?

I'm not entirely sure I understand your question, but I think this is what you need:

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

Theme © iAndrew 2016 - Forum software by © MyBB