SQL update not working
#3

Update, not insert. And while we're at it, this block of code can be compacted. Always avoid duplicate code. If a change is to be made, you want to do it in only one place.

pawn Код:
if(dialogid == SEXMENU) // could probably use a switch here, as well
{
    new name[MAX_PLAYER_NAME], query[128];
    GetPlayerName(playerid, name, sizeof(name));
   
    format(query, sizeof(query), "UPDATE accounts SET psex=%d WHERE name='%s'", (response) ? 1 : 2, name);
    mysql_function_query(sqlconnect, query, false, "", "");
   
    SetPlayerSkin(playerid, (response) ? 185 : 193);
    ShowPlayerDialog(playerid, AGEMENU, DIALOG_STYLE_INPUT, "{00C0FF}Amzius", "{FFFFFF}Kiek jums metu ?", "Submit", "Cancel");
}
Reply


Messages In This Thread
SQL update not working - by cyberlord - 14.12.2014, 11:57
Re: SQL update not working - by zT KiNgKoNg - 14.12.2014, 12:01
Re: SQL update not working - by Vince - 14.12.2014, 12:10
Re: SQL update not working - by cyberlord - 14.12.2014, 12:13
Re: SQL update not working - by cyberlord - 14.12.2014, 13:48
Re: SQL update not working - by cyberlord - 14.12.2014, 15:52
Re: SQL update not working - by cyberlord - 14.12.2014, 17:38

Forum Jump:


Users browsing this thread: 1 Guest(s)