Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 4 get last query
#1

How can i  print the last query in a view ?
Reply
#2

PHP Code:
// controller
$data['lastQuery'] = $db->getLastQuery();

// view
<?= $lastQuery?>

if you need to do all of this in the view you would need and instance of the database connection
and model.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB