Mysql admin command problem +rep
#1

PROBLEM FIXED
Reply
#2

Код:
format(Queryy,sizeof(Queryy),"SELECT `admin` FROM `playerdata` WHERE `username` LIKE '%s' LIMIT 1",PlayerName(playerid));
EDIT: By the way, change true with 1.
Reply
#3

Still allows me to use healall cmd

pawn Код:
stock player_admin(playerid)
{
    new Queryy[100];
    format(Queryy,sizeof(Queryy),"SELECT `admin` FROM `playerdata` WHERE `username`='%s' LIMIT 1",PlayerName(playerid));
    mysql_query(Queryy);
    mysql_free_result();
    return 1;
}
Reply
#4

You forgot to add the mysql_store_result(); Add it after mysql_query
Reply
#5

Quote:
Originally Posted by Bogdan1992
Посмотреть сообщение
You forgot to add the mysql_store_result(); Add it after mysql_query
lol still allows me to use admin cmd
Reply
#6

what do you have in that row? 1 and 0 right? if yes then

Код:
format(Queryy,sizeof(Queryy),"SELECT `admin` FROM `playerdata` WHERE `username` LIKE '%s' AND `admin` = 1 LIMIT 1",PlayerName(playerid));
Reply
#7

[QUOTE=Bogdan1992;1777953]what do you have in that row? 1 and 0 right? if yes then

if it is 0 it can use cmd but if is 1 it can
Reply
#8

PROBLEM FIXED
Reply
#9

You're not taking the data from the mysql.
Reply
#10

Quote:
Originally Posted by (A)rray
Посмотреть сообщение
You're not taking the data from the mysql.
what's the problem why i can't take date

EDIT: debug text

Quote:

[15:15:15] CMySQLHandler::Query(SELECT `admin` FROM `playerdata` WHERE `username` LIKE '[BG]PREDATOR' AND `admin` = 1 LIMIT 1) - Successfully executed.

[15:15:15] >> mysql_store_result( Connection handle: 1 )

[15:15:15] CMySQLHandler::StoreResult() - Result was stored.

[15:15:15] >> mysql_free_result( Connection handle: 1 )

[15:15:15] CMySQLHandler::FreeResult() - Result was successfully free'd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)