Mysql
#10

Quote:
Originally Posted by Luis-
Посмотреть сообщение
How exactly do you know this? You have no proof?
pawn Код:
forward ConnectMySQL();
public ConnectMySQL()
{

    xSF=mysql_connect( LOCAL_HOST, LOCAL_USER, LOCAL_DB, LOCAL_PASS );

    if(mysql_ping(xSF) == 1)
    {
        mysql_debug(xSF);
        printf("[MYSQL]:first Connection to `DATABASE` succesful! || %d",xSF);
    }
    else
    {
      mysql_close(xSF);
      printf("[MYSQL]: [ERROR]:first Connection to `DATABASE` failed!");
      xSF=mysql_connect( LOCAL_HOST, LOCAL_USER, LOCAL_DB, LOCAL_PASS );
      if(mysql_ping(xSF) == 1)
         {
            mysql_debug(xSF);
            printf("[MYSQL]:second Connection to `DATABASE` succesful! || %d",xSF);
         }
         else printf("[MYSQL]: [ERROR]:second Connection to `DATABASE` failed!");

    }
    return 1;
}
pawn Код:
#define HOST_R                  ":: xSF »  Xtreme Stunt Freeroam  (0.3.7R2) ::"
#define NAME_S                  "xSF"
#define VERSION_B               "V1.3"
#define RESPAWN_TIME            ( 25 )

#define HOSTNAME_1              ":: xSF »  Xtreme Stunt Freeroam (0.3z)  :: "
#define HOSTNAME_2              ":: xSF »  Stunt/DM/Race/Derby/Minigames  :: "
#define HOSTNAME_3              ":: xSF »   Xtreme Stunt Freeroam  (0.3z) :: "
#define HOSTNAME_4              ":: xSF »  Stunt/DM/Race/Derby/Minigames  :: "

#define SITETD_1                "~y~~h~xSF"
#define SITETD_2                "~r~~h~xSF"
#define SITETD_3                "~b~~h~xSF"
#define SITETD_4                "~p~~h~xSF"
#define MYSQL_VERSION              "R7 by Blueg"
// ( MySQL Configuration Panel )
#define USE_LOCALHOST           ( true )
#define USE_ANTI_STEALER        ( false )
#define ENABLE_DEBUGING         ( 0 )
#define SERVER_FORUM            "Example.com"
#define MAX_CONNECTIONS_FROM_IP ( 15 )
pawn Код:
gsString[ 0 ] = EOS;
            new
                Buf[ 129 ]
            ;
            WP_Hash( Buf, 129, rPassword );

            new
                liYear,
                liMonth,
                liDay
            ;
            getdate( liYear, liMonth, liDay );
            new  year, month, day;
            getdate( year, month, day );
            format( gsString, sizeof( gsString ), "INSERT INTO `accounts` \
                                                         VALUES(0, '%s', '%s', '%s', '%d-%d-%d','%d/%d/%d', '0', '0', '0', '0', '0', '0', \
                                                           '0', '0', '0', '00:00:00', '0', '0', '0' '0', \
                                                          '0', '0', '0', 'None.', '0', '0', 'None', '0', '0', '0', 0"
, PlayerName( playerid ), GetPlayerIPEx( playerid ), Buf, liYear, liMonth, liDay,year,month,day);
            format( gsString, sizeof( gsString ), "%s, '0', '0', '0', '0', '0', \
                                                   '0', '0', '0', '00:00', '0', '00:00', '0', '0xFFFFFFFF', \
                                                   ' 0', '0', '00:00:00', '0',0, 0, '0', '0','0', 0, '0', '0', '0','5','22', 33, '1', '0', '0','0','0','0', '0', '0', '0', '0', '0', '0', '0', '0', '0')"
, gsString );
            mysql_query( gsString );
            PlayerInfo[ playerid ][ AccID ] = mysql_insert_id( );
pawn Код:
/**
 * MySQL plugin R7
 * Copyright © 2008-2011, BlueG
 */


#if defined mysql_included
    #endinput
#endif
#define mysql_included

/**
 * Common error codes
 *
 * Client: http://dev.mysql.com/doc/refman/5.0/en/e...lient.html
 * Server: http://dev.mysql.com/doc/refman/5.0/en/e...erver.html
 *
 */


#define ER_DBACCESS_DENIED_ERROR 1044
#define ER_ACCESS_DENIED_ERROR 1045
#define ER_UNKNOWN_TABLE 1109
#define ER_SYNTAX_ERROR 1149
#define CR_SERVER_GONE_ERROR 2006
#define CR_SERVER_LOST 2013
#define CR_COMMAND_OUT_OF_SYNC 2014
#define CR_SERVER_LOST_EXTENDED 2055

// Native functions

#define mysql_fetch_row(%1) mysql_fetch_row_format(%1,"|")
#define mysql_next_row() mysql_retrieve_row()
#define mysql_get_field(%1,%2) mysql_fetch_field_row(%2,%1)

#define mysql_query_callback(%1,%2,%3,%4,%5) \
    mysql_function_query(%5,%2,false,%3,"siii",%2,%1,%4,%5)
Reply


Messages In This Thread
Mysql - by Loinal - 15.05.2017, 10:21
Re: Mysql - by iLearner - 15.05.2017, 10:24
Re: Mysql - by coool - 15.05.2017, 10:27
Re: Mysql - by Loinal - 15.05.2017, 10:39
Re: Mysql - by Logic_ - 15.05.2017, 11:16
Re: Mysql - by Loinal - 15.05.2017, 11:26
Re: Mysql - by Logic_ - 15.05.2017, 12:29
Re: Mysql - by Loinal - 15.05.2017, 20:08
Re: Mysql - by Luis- - 15.05.2017, 20:40
Re: Mysql - by Despacito - 15.05.2017, 23:21

Forum Jump:


Users browsing this thread: 1 Guest(s)