Need Help
#1

please I don't know what is the problem here - help me

stock SavePlayerVariable(playerid,set[],value)
{
new SQL[256];
format(SQL,sizeof(SQL),"UPDATE `users` SET '%s' = '%s' WHERE `username` = '%s'",set,value,GetName(playerid));
mysql_query(SQL);
}
Reply
#2

Quote:
Originally Posted by dvir174
Посмотреть сообщение
please I don't know what is the problem here - help me

stock SavePlayerVariable(playerid,set[],value)
{
new SQL[256];
format(SQL,sizeof(SQL),"UPDATE `users` SET '%s' = '%s' WHERE `username` = '%s'",set,value,GetName(playerid));
mysql_query(SQL);
}
You ahold post he error message but by the looks of it u didn't make the string properly
pawn Код:
stock SavePlayerVariable(playerid,set[256],value)
{
    new SQL[256];
    format(SQL,sizeof(SQL),"UPDATE `users` SET '%s' = '%s' WHERE `username` = '%s'",set,value,GetName(playerid));
    mysql_query(SQL);
}
Reply
#3

Quote:
Originally Posted by dvir174
Посмотреть сообщение
please I don't know what is the problem here - help me

stock SavePlayerVariable(playerid,set[],value)
{
new SQL[256];
format(SQL,sizeof(SQL),"UPDATE `users` SET '%s' = '%s' WHERE `username` = '%s'",set,value,GetName(playerid));
mysql_query(SQL);
}
If the vakue is a string:
pawn Код:
stock SavePlayerVariable(playerid,set[],value[])
{
    new SQL[256];
    format(SQL,sizeof(SQL),"UPDATE `users` SET '%s' = '%s' WHERE `username` = '%s'",set,value,GetName(playerid));
    mysql_query(SQL);
if the value is an int
pawn Код:
stock SavePlayerVariable(playerid,set[],value)
{
    new SQL[256];
    format(SQL,sizeof(SQL),"UPDATE `users` SET '%s' = '%d' WHERE `username` = '%s'",set,value,GetName(playerid));
    mysql_query(SQL);
Reply
#4

thank you - I took both of your suggestions also added something of my own and connected them and this is the end result

stock SavePlayerVariable(playerid,set[256],value)
{
new SQL[256];
format(SQL,sizeof(SQL),"UPDATE `users` SET `%s` = '%d' WHERE `username` = '%s'",set,value,GetName(playerid));
mysql_query(SQL);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)