Not updating mysql database
#1

We have a makeadmin command. Now when we try to update the database to SAY the level we set. It doesnt. We have a printf to print into the console, and it does. So it cannot be liking the mysql_tquery.

Heres the command.

PHP код:
CMD:makeadmin(playeridparams[])
{
    new 
playerbstring[256], string1[256], level;
    if(
pInfo[playerid][Admin] < && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"SERVER: Unknown command.");
    if (
sscanf(params"ui"playerblevel)) return SendClientMessage(playerid, -1"Usage: /makeadmin [Playerid/part of name] [Level]");
    if(!
IsPlayerConnected(playerb)) return SendClientMessage(playeridCOL_ERROR"ERROR: That player is not connected!");
    if(
level && level 1337) return SendClientMessage(playeridCOL_ERROR"ERROR: Invalid level(Use level 1-4)");
    
pInfo[playerb][Admin] = level;
    
format(stringsizeof(string), "You have made %s a level %i Admin!"GetName(playerb), level);
    
SendClientMessage(playeridCOL_HELPERstring);
    
format(string1sizeof(string1), "%s has made you a level %i Admin!"GetName(playerid), level);
    
SendClientMessage(playerbCOL_HELPERstring1);
    
mysql_format(mysqlquerysizeof(query), "UPDATE `users` SET `Admin`=%i WHERE `Username`=%s"pInfo[playerb][Admin], GetName(playerb));
    
printf("%s"query);
    
mysql_tquery(mysqlquery);
    return 
1;

Reply
#2

pawn Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Admin`='%i' WHERE `Username`='%s'", pInfo[playerb][Admin], GetName(playerb));
Reply
#3

Quote:
Originally Posted by Death1300
Посмотреть сообщение
pawn Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `Admin`='%i' WHERE `Username`='%s'", pInfo[playerb][Admin], GetName(playerb));
Thanks it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)