[HELP] MySQL Registration Failure
#1

hey guys im back from playing certain games and wanted back to script. In those case i have a little bit problem that i can't even figure out how to solve this. Hope you guys know how to solve this mysql registration failure.

pawn Код:
public OnPlayerConnect ( playerid )
{
    new pName [ MAX_PLAYER_NAME ]  ;
    SetPVarInt ( playerid , "Logged" , 0 ) ;
    GetPlayerName ( playerid , pName , sizeof ( pName ) ) ;
    format ( Query , sizeof ( Query ) , "SELECT * FROM `data` WHERE `Name` = '%s'" , pName ) ;
    mysql_query ( Query ) ;
    mysql_store_result ( ) ;
    if ( mysql_num_rows ( ) == 1 )
    {
        format ( String , sizeof ( String ) , ""LIGHTGREEN"Enter your password to proceed" ) ;
        ShowPlayerDialog ( playerid , DIALOG_LOGIN , DIALOG_STYLE_PASSWORD , DIALOG_TITLE , String , "Submit" , "" ) ;
    }
    else if ( mysql_num_rows ( ) == 0 )
    {
        format ( String , sizeof ( String ) , ""LIGHTGREEN"Enter your password to register" ) ;
        ShowPlayerDialog ( playerid , DIALOG_REGISTER , DIALOG_STYLE_PASSWORD , DIALOG_TITLE , String , "Submit" , "" ) ;
    }
    mysql_free_result ( ) ;
    return 1 ;
}
pawn Код:
case DIALOG_REGISTER:
        {
            if ( response )
            {
                if ( strlen ( inputtext ) < 0 || strlen ( inputtext ) > 100 )
                {
                    format ( String , sizeof ( String ) , ""LIGHTGREEN"You dont not enter any string or you just exceeding limit of password" ) ;
                    ShowPlayerDialog ( playerid , DIALOG_REGISTER , DIALOG_STYLE_PASSWORD , DIALOG_TITLE , String , "Submit" , "" ) ;
                }
                else
                {
                    new pName [ MAX_PLAYER_NAME ] ;
                    GetPlayerName ( playerid , pName , sizeof ( pName ) ) ;
                    mysql_real_escape_string ( inputtext , inputtext ) ;
                    format ( Query , sizeof ( Query ) , "INSERT INTO `data` ( `Name` , `Level` , `Password` , `Kill` , `Death` , `Money` , `Score` ) VALUES( '%s' , 0 , '%s' , 0 , 0 , 10000 , 0 )" , pName , inputtext ) ;
                    mysql_query ( Query ) ;
                   
                    SetPVarInt ( playerid , "Level" , 0 ) ;
                    SetPVarInt ( playerid , "Kill" , 0 ) ;
                    SetPVarInt ( playerid , "Death" , 0 ) ;
                    GivePlayerMoney ( playerid , 10000 ) ;
                    SetPlayerScore ( playerid , 0 ) ;
                    SetPVarInt ( playerid , "Logged" , 1 ) ;
                }
            }
            return 1 ;
        }
those are the codes for registration on mysql database.
Reply


Messages In This Thread
[HELP] MySQL Registration Failure - by AK47317 - 31.12.2011, 02:37
Re: [HELP] MySQL Registration Failure - by [HiC]TheKiller - 31.12.2011, 03:35
Re: [HELP] MySQL Registration Failure - by AK47317 - 01.01.2012, 01:04
Re: [HELP] MySQL Registration Failure - by GamingTurf - 01.01.2012, 02:05
Re: [HELP] MySQL Registration Failure - by AK47317 - 01.01.2012, 02:08
Re: [HELP] MySQL Registration Failure - by GamingTurf - 01.01.2012, 02:11
Re: [HELP] MySQL Registration Failure - by AK47317 - 01.01.2012, 07:54
Re: [HELP] MySQL Registration Failure - by AK47317 - 02.01.2012, 04:38
Re: [HELP] MySQL Registration Failure - by Johnson_boy - 02.01.2012, 07:03
Re: [HELP] MySQL Registration Failure - by AK47317 - 02.01.2012, 09:14

Forum Jump:


Users browsing this thread: 1 Guest(s)