Debug SQL generated with InsertObject/UpdateObject

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
ArnorBld
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Dec 09, 2016 10:51 pm

Debug SQL generated with InsertObject/UpdateObject

Post by ArnorBld » Thu Sep 16, 2021 1:19 am

Hi,

I don't know if this is the correct forum for this question.

I work on proprietary components for a client. I like to use the InsertObject and UpdateObjects to insert and update SQL tables. When using queries you can use __toString() method to get the SQL query being sent to the database. I really miss that when using Insert/Update Object. Is there any way to get to the SQL query that unsertObject/updateObject generate and execute?

Thank you!
Last edited by toivo on Thu Sep 16, 2021 1:31 am, edited 1 time in total.
Reason: mod note: moved from 3.x Administration

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2886
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: Debug SQL generated with InsertObject/UpdateObject

Post by SharkyKZ » Thu Sep 16, 2021 5:15 am

You can use $db->getQuery() to see the query that was executed using these methods. If you need to get the query before it's executed, you'd need to write custom methods to split the query building part and execution part.


Locked

Return to “Joomla! 3.x Coding”