I am just curious to see if there is a way to transfer or re-use a connection opened by mysql_connect()
to PDO.
I know this is incorrect (hoping to get the sort of idea across), but i was hoping for something like
$pdo = new PDO($mysql_connect_link); // yes this is wrong, i know!
for example.
The reason is that I want to use PDO
in my class to manage queries and such, however, the class itself doesn't open the connection to the database. It requires a connection to be established beforehand (which I have been checking via the standard mysql_*
() function set for now. Ew, I know.)
I would like for the class's queries to work regardless on the user opening a connection to the database via mysql_*
or PDO
... Does anyone have any thoughts and/or suggestions on this matter?