0

I want to print query before Updating in database in CODEIGNITER.

    $data['name'] = $name;
    $data['email'] = $email;
    $data['mobileNo'] = $mobileNo;
    $data['areaID'] = $areaID;
    $data['address'] = $address;
    $this->db->update('db_SaleDetail', $data);

1 Answer 1

1

I've never use Codeigniter, but I think something with transaction & rollback will work :

$this->db->transStart(true); // start transaction, so we can rollback after
$data['name'] = $name;
$data['email'] = $email;
$data['mobileNo'] = $mobileNo;
$data['areaID'] = $areaID;
$data['address'] = $address;
$this->db->update('db_SaleDetail', $data);
var_dump( $this->db->last_query() ); // display the query
$this->db->transRollback(); // cancel update
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.