Page 1 of 1

getting last query from adodb

Posted: Mon Sep 18, 2006 2:07 pm
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:

Posted: Mon Sep 18, 2006 2:37 pm
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?

Posted: Mon Sep 18, 2006 2:56 pm
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 ;)

Posted: Mon Sep 18, 2006 2:58 pm
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.