mysql regis counting not working
#1

pawn Код:
NewReg()
{
    format(query, sizeof query, "SELECT * FROM `serverdata` WHERE `Registrations` LIMIT 1");
    mysql_query(query);
    mysql_store_result();
    TotalRegis = mysql_fetch_int();
    mysql_free_result();
   
    TotalRegis ++;
   
    format(query, sizeof query, "UPDATE `serverdata` SET `Registrations` = '%i'", TotalRegis);
    mysql_query(query);
}
It keeps saying '0'
Reply
#2

ehm... I don't understand your code lol.. you should learn the mysql basics..
however I guess you want something like this:
pawn Код:
new query[200];
format(query, sizeof(query), "UPDATE `serverdata` SET `Registrations`=Registrations+1");
mysql_query(query);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)