View Single Post
BAILOPAN
Join Date: Jan 2004
Old 06-11-2004 , 23:19  
Reply With Quote #4

If the result is an empty set, the return value for the result handle (in this program, it is res), will be 0.

That's why I did <0 for INSERT, to check if the insert succeeded, and <=0 for SELECT, to make sure there were items in the table.

Last insert id is a MySQL only feature so I won't add it to the DBI I think. You can do this:
SELECT MAX(field) FROM table
and get the first (only) result.
__________________
egg
BAILOPAN is offline