getting last query from adodb

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

getting last query from adodb

Post by Luke »

I can't figure out how to get the last query that was attempted via adodb. Does anybody know how I could do this? I'm using the active record add-on temporarily until I can roll my own, but there is an error with one of it's generated queries, but I don't know how to look at the query to figure out what's going on... :evil:
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://phplens.com/lens/adodb/docs-adodb.htm#php5
Exceptions: Just include adodb-exceptions.inc.php and you can now catch exceptions on errors as they occur.
Do you use php5?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

yup... but I use php4 on a lot of projects as well, so I'd like to be able to figure this stuff out in either environment.

Jcart | ahem, spelling ;)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

maybe http://phplens.com/lens/adodb/docs-adodb.htm#ex4
In the above example, we have turned on debugging by setting debug = true. This will display the SQL statement before execution, and also show any error messages. There is no need to call ErrorMsg() in this case. For displaying the recordset, see the rs2html() example.
Post Reply