php - Is there a way to set the default database handle with mysql_query? -


Is there a way to set default database handle with mysql_query? So I know that mysql_query can be called without a SQL handle, but then it will basically use whatever you get with previous mysql_connect if I want to decide The default is to handle myself, so how can I do it?


I want to make it clear that we have all the code written without our handler. We do not have those changes that we have some code that changes the database between different database clusters. We want to be able to switch between databases repeatedly without having to call mysql_connect.

Super Ghetto version.

$ defaultHandle; Function SetDefaultHandle ($ handle) {global $ defaultHandle; $ DefaultHandle = $ Handle; } Function q ($ query) {global $ defaultHandle; Return mysql_query ($ query, $ defaultHandle); }

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -