AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SQL <-> AMXX Behaviour Question (https://forums.alliedmods.net/showthread.php?t=53698)

Silencer123 04-09-2007 10:49

SQL <-> AMXX Behaviour Question
 
Simple question:
If there is a connection made to an SQL server (by AMXX) but internet is slooow, lets say it requires 5 seconds, and 3 seconds after that connection started, another connection, for retrieving another players data, is being made, will this second connection be ruined by the dbi_close from the first data-retrieval? If yes, then I already have an idea on how to fix that, if not, then "Hooray!". I am sorry if this has been asked one million times until now, but I did not find thread about this during my search. I am also sorry if this does not perfectly fit into this Topic - well, the fix would be about scripting, at least.
Thanks in advance.

Nican 04-09-2007 11:06

Re: SQL <-> AMXX Behaviour Question
 
Well...
You have two options:

1. You can make pernament connection, that you open the connection at plugin_init, and closes it at plugin_end
PS: Might be useful to re-open the connection every 200sec, or the server will drop you

2. You can make something like:
PHP Code:

new mysqlconections 0;

public 
openmysql(){
    if(
mysqlconections == 0){
        
//Conenct to server    
    
}
    
mysqlconections++;    
}

public 
closemysql(){
    
mysqlconections--;
    if(
mysqlconections == 0){
        
//Close to server    
    
}


I do not know how to express that in words D:

Silencer123 04-09-2007 14:02

Re: SQL <-> AMXX Behaviour Question
 
Thats just the Idea I had. ^^


All times are GMT -4. The time now is 06:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.