Ronak Chauhan
Ronak Chauhan

Reputation: 706

Codeigniter Profiler not showing INSERT and UPDATE queries

I am working on codeigniter 3.0 and need to print all queries in page. I used this

$this->output->enable_profiler(TRUE);

But its not working its showing only SELECT queries.

Even I tried with HOOK but its still printing SELECT queries in log file. Can anyone please help me ?

Upvotes: 4

Views: 1299

Answers (3)

Anand Pandey
Anand Pandey

Reputation: 2025

Please add this line and check after the class definition.

  public function __construct()
  {
      parent::__construct();
      $this->db->save_queries = TRUE; //It is used for profiler query
   }

Upvotes: 0

Rajat Jain
Rajat Jain

Reputation: 2032

Have you tried to add:

$this->db->save_queries = TRUE;

Upvotes: 1

Cody Helscel
Cody Helscel

Reputation: 57

Seems like your INSERT queries are processed after the profiler is processed. Perhaps you're using AJAX? What log files? I haven't used them for CodeIgniter specifically. If using AJAX, the CodeIgniter framework might not catch certain queries when we expect them.

I'm assuming the INSERT queries are being being executed, but if they're not, then I would check that first.

Upvotes: 0

Related Questions