CodeIgniter Forums

Full Version: SQL Query Statement
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to get insert query statement before execution in 3.1.4 version
You can use get_compiled_insert().

Example:
PHP Code:
$data = array(
 
       'employee_id' => 'Employee id number',
 
       'user_type' => 'Type of User',
 
       'username' => 'Username of User',
 
       'password' => 'Password of the user'
);

$result $this->db->set($data)->get_compiled_insert('user');
echo 
$result

(In this example, 'user' is the table name).