14.12.2014, 11:57
hello and this is my code :
what do i want to do is update one column in my sql db this code dont give my any error but it wont update my sql aswell ware can by a problem .this code is about gender its gives dialog and let u choose what gender is yours and i need to save and set 1 for male and 2 for female into db , please help
Код:
if(dialogid == SEXMENU) { if(response) { //man new name[MAX_PLAYER_NAME],query[128],psex[2]; GetPlayerName(playerid,name,sizeof(name)); format(query,sizeof(query),"INSERT INTO accounts WHERE name='%s' (psex) VALUES ('1') ",psex); mysql_function_query(sqlconnect,query,false,"",""); SetPlayerSkin(playerid, 185); ShowPlayerDialog(playerid, AGEMENU, DIALOG_STYLE_INPUT, "{00C0FF}Amzius", "{FFFFFF}Kiek jums metu ?", "Submit", "Cancel"); return 0; } else { //woman new name[MAX_PLAYER_NAME],query[128],psex[2]; GetPlayerName(playerid,name,sizeof(name)); format(query,sizeof(query),"INSERT INTO accounts WHERE name='%s' (psex) VALUES ('2') ",psex); mysql_function_query(sqlconnect,query,false,"",""); SetPlayerSkin(playerid, 193); ShowPlayerDialog(playerid, AGEMENU, DIALOG_STYLE_INPUT, "{00C0FF}Amzius", "{FFFFFF}Kiek jums metu ?", "Submit", "Cancel"); return 0; } }