johnsmith153 Posted April 3, 2009 Share Posted April 3, 2009 If I just do: mysql_query($sql); then the most recently OPENED connection will be used. Is there a way to use the current ACTIVE connection? (not the recently opened one) I am hoping for an alternative to just using: mysql_query($sql,$connectionNumber); (1) I open connection 1 (2) I open connection 2 (3) I close connection 2 (4) when I do mysql_query($sql); it can not find a connection (but I want it to use the one that is open) Link to comment https://forums.phpfreaks.com/topic/152339-quick-simple-sql-question/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 3, 2009 Share Posted April 3, 2009 Post your code. If you are using the same host/user/password for connection #2, by default you are not opening a second connection, just reusing the first one - If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. Link to comment https://forums.phpfreaks.com/topic/152339-quick-simple-sql-question/#findComment-800061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.