AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   mysql question (https://forums.alliedmods.net/showthread.php?t=84845)

whosyourdaddy 02-01-2009 19:25

mysql question
 
lets say i do
Code:

SQL_Connect
to connect to my mysql database, am i going to stay connected until i do
Code:

SQL_FreeHandle


on the queries or do i get disconnected from the mysql after x amount of minutes that go by

edited*

and can any1 tell me the difference between
Code:

format( szQuery, 511, "REPLACE INTO `wc3_player_race` ( `player_id` , `race_id` , `race_xp` ) VALUES ( '%d', '%d', '%d');", iUniqueID, p_data[id][P_RACE], p_data[id][P_XP] );
SQL_ThreadQuery( g_DBTuple, "_MYSQLX_Save_T", szQuery );
 
public _MYSQLX_Save_T( failstate, Handle:query, error[], errnum, data[], size )
{
    // Error during the query
    if ( failstate )
    {
        new szQuery[256];
        SQL_GetQueryString( query, szQuery, 255 );

        MYSQLX_ThreadError( query, szQuery, error, errnum, failstate, 1 );
    }
}


and
Code:

format( szQuery, 511, "REPLACE INTO `wc3_player_race` ( `player_id` , `race_id` , `race_xp` ) VALUES ( '%d', '%d', '%d');", iUniqueID, p_data[id][P_RACE], p_data[id][P_XP] );
new Handle:query = SQL_PrepareQuery( g_DBConn, szQuery );
    if ( !SQL_Execute( query ) )
    {
        client_print( id, print_chat, "%s Error, unable to save your XP, please contact a server administrator", g_MODclient );
        MYSQLX_Error( query, szQuery, 4 );
        return;
    }




All times are GMT -4. The time now is 01:54.

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