Jump to content

quick, simple SQL question


johnsmith153

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.