Home
Forums
Members
Search
Help
New topics
Todays topics
Website
Welcome Guest, Not a member yet?
Register
Sign In
Login
Username:
Password:
Remember me
Lost Password?
CodeIgniter Forums
Using CodeIgniter
General Help
Accessing protected property of query object
Share on Google
Share on Facebook
Share on Twitter
View a Printable Version
Subscribe to this thread
Add Poll to this thread
Send thread to a friend
Linear Mode
Threaded Mode
Accessing protected property of query object
occitan
Newbie
Posts:
9
Threads:
6
Joined:
Sep 2024
Reputation:
0
#1
01-28-2025, 04:36 PM
Is there a way to set the output of getLastQuery() ->Â finalQueryString to a variable?Â
In normal PHP you use the Reflection class, is there a way to access this in CI4?
Reply
occitan
Newbie
Posts:
9
Threads:
6
Joined:
Sep 2024
Reputation:
0
#2
02-05-2025, 01:10 AM
Anyone?
I am making AJAX calls that return a database result and i want to return the last query so i can see it, how do I do this?
Reply
JustJohnQ
Member
Posts:
236
Threads:
3
Joined:
Mar 2022
Reputation:
13
#3
02-05-2025, 02:37 AM
(This post was last modified: 02-05-2025, 02:38 AM by
JustJohnQ
.)
Would something like this work:
PHP Code:
$lastQuery
=
$this
->
db
->
getLastQuery
()->
__toString
();
Reply
--------------------
Private Messages
User Control Panel
Who's Online
Search
Forum Home
General
-- News & Discussion
-- Events
-- Lounge
-- Regional User Groups
Using CodeIgniter
-- Installation & Setup
-- Model-View-Controller
-- Libraries & Helpers
-- Best Practices
-- Choosing CodeIgniter
-- General Help
CodeIgniter 4
-- CodeIgniter 4 Roadmap
-- CodeIgniter 4 Development
-- CodeIgniter 4 Feature Requests
-- CodeIgniter 4 Support
-- CodeIgniter 4 Discussion
-- CodeIgniter 4 Addins
Development
-- CodeIgniter 3.x
-- CodeIgniter 2.x
-- Issues
-- NetBeans Plugin
External Resources
-- Spotlight
-- Learn More
-- Jobs
-- Addins
Archived Discussions
-- Archived Libraries & Helpers
-- Archived Development & Programming
Theme © iAndrew 2016 -
Forum software by © MyBB