0

I want to print SQL query from my stored procedure.

My procedure like:

$Insert-array = my values;

$query = $this->db->query("CALL Category(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,@id)", $Insert-array);

I use print_r($this->db->last_query());.

My result looks like this:

CALL Category(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,@id)

When I use print query statement.. now how can I print the SQL statement query from the stored procedure?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Viral Patel
  • 181
  • 10

1 Answers1

0

I'll usually include a DEBUG param that defaults to false and I can set to true at run time. Then wrap the debug statements into an "If DEBUG" block.

I also use a logging table with many of my jobs so that I can review processes and timing. My Debug code gets output there as well. I include the calling param name, a brief description, row counts affected (if appropriate), a comments field and a time stamp.

for more about debugging please refer here

Pranav MS
  • 2,235
  • 2
  • 23
  • 50