When you open a MySQL connection with mysql_connect(), it returns a link identifier. But what if you want to get that link identifier again later in the script? (for example: A plug-in, that needs to open a new database connection, and still access the old one.)
I’m looking for a way to return a link identifier to the last connection opened by mysql_connect(). Is there a function that does this?
Thanks to everyone for the replies.
I ended up opening my own connection, and when my plug-in was done, the last line reopens the initial connection so the rest of the main script can use the database it expects. It’s sloppy, I know, but it doesn’t seem like there’s a better option in this case. :/
Update:: I’ve submitted this as a feature request on php.net. The link is: http://bugs.php.net/bug.php?id=49400