Hi, I'm writing a function that can be included in any php page on my site.
The function does some work and looks some stuff up in a database.
Now what I want to do in the function is check if there is already a database connection set up, and if there is get the name of the database that php is currently looking at, so that at the end of this function in the include, I can return the database handle to be looking at the original database again, so things are left 'as they were' before the function was included.
I've looked in the manual, but couldn't find anything that would give me the name of the database that php is currently connected to.
Thanks a lot anyone who replies.