SQL query
#1

Hello, the below code does the following on the console

pawn Код:
stock SaveStats(playerid)
{
    format(SQL_Query,sizeof(SQL_Query),"UPDATE `Accounts` SET `Money` = '%d', `Level` = '%d', `AdminLevel` = '%d', `Faction` = '%d', `FactionRank` = '%d', `RegistrationStep` = '%d', `BirthDay` = '%d', `BirthMonth` = '%d', `BirthYear` = '%d', `SpawnPoint` = '%d', `TutorialComplete` = '%d' WHERE `Username` = '%s'",
    Player[playerid][Money],
    Player[playerid][Level],
    Player[playerid][AdminLevel],
    Player[playerid][Faction],
    Player[playerid][FactionRank],
    Player[playerid][RegistrationStep],
    Player[playerid][BirthDay],
    Player[playerid][BirthMonth],
    Player[playerid][BirthYear],
    Player[playerid][SpawnPoint],
    pName(playerid));
   
    mysql_query(SQL_Query);
    mysql_free_result();
    return 1;
}

Код:
[02:16:53] CMySQLHandler::Query(UPDATE `Accounts` SET `Money` = '0', `Level` = '0', `AdminLevel` = '1', `Faction` = '0', `FactionRank` = '0', `RegistrationStep` = '3', `BirthDay` = '24', `BirthMonth` = '5', `BirthYear` = '1952', `SpawnPoint` = '0', `TutorialComplete` = '74' WHERE `Username` = '') - Successfully executed.

[02:16:53] >> mysql_free_result( Connection handle: 1 )

[02:16:53] CMySQLHandler::FreeResult() - The result is already empty.
It doesn't do anything in the database and I don't know what's up with it.

Thanks for any help given!
Reply


Messages In This Thread
SQL query - by iGetty - 23.05.2012, 01:12
Re: SQL query - by Jonny5 - 23.05.2012, 01:35
Re: SQL query - by iGetty - 23.05.2012, 01:42
Re: SQL query - by Jonny5 - 23.05.2012, 01:53
Re: SQL query - by iGetty - 23.05.2012, 02:02
Re: SQL query - by Jonny5 - 23.05.2012, 02:06
Re: SQL query - by Jonny5 - 23.05.2012, 02:08
Re: SQL query - by iGetty - 23.05.2012, 02:12

Forum Jump:


Users browsing this thread: 3 Guest(s)