Welcome Guest, Not a member yet? Register   Sign In
Printing Query error
#1

IN CI 3 when there was sql error it prints the whole error query then we find out the error and resolve it but in CI4 only it saying the there was error on line X but did not print the whole query so that we could debug it.

How can CI 4 can print the whole error query ?
Please help.
Reply
#2

@samiul1978,

Maybe this is what your looking for... https://codeigniter.com/user_guide/datab...ing-errors
Reply
#3

(08-26-2020, 09:00 AM)php_rocs Wrote: @samiul1978,

Maybe this is what your looking for... https://codeigniter.com/user_guide/datab...ing-errors
Do you know if there is sql error happened in CI 3 then what happened ? I want exactly the same thing in CI 4.printing the whole error query.
Reply
#4

@samiul1978,

In CI3 I usually checked the log assuming I didn't see the sql error message directly on the screen. Maybe this can be helpful to you ... https://codeigniter.com/user_guide/gener...nformation
Reply
#5

Hi,

This might help...


PHP Code:
        $sql $this->db->showLastQuery();
        print_r($sql); 

It will show you what was actually run.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB