Welcome Guest, Not a member yet? Register   Sign In
How to add my function in db class
#1

[eluser]spezia 018[/eluser]
Hi All,

I have one problem.

I want to make next function in db class:

$this->db->my_function.

Example:

Code:
public function get_sql_error() {
    
    $text = $this->db->_error_message();
      
    if(!empty($text))
    {

      throw new Exception("SQL error: $text");
    } else {
      
      return;
    }
  }


I always have in controller try{} catch {}, and because that I need Exception.

How to make $this->db->get_sql_error() ???

Thanks
#2

[eluser]benton.snyder[/eluser]
Check out https://github.com/EllisLab/CodeIgniter/...se-Drivers
#3

[eluser]spezia 018[/eluser]
Thanks a lot




Theme © iAndrew 2016 - Forum software by © MyBB