SA-MP Forums Archive
mysql regis counting not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: mysql regis counting not working (/showthread.php?tid=260780)



mysql regis counting not working - swieberdevos - 10.06.2011

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'


Re: mysql regis counting not working - Sascha - 10.06.2011

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);