SA-MP Forums Archive
MYSQL Help - 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)
+--- Thread: MYSQL Help (/showthread.php?tid=557887)



MYSQL Help - SpriTe - 15.01.2015

Hello, i have a question.
new Cache:result = mysql_query(handle, "SELECT `username` FROM `players`");
new account = cache_get_row_count(),name[25];
cache_get_field_content(account-1, "username", name, handle, 25);
cache_delete(result);

It's ok this code? But I need to get the number of players who have field "Language" set on value 1, the field is on the players table.


Re: MYSQL Help - Vince - 15.01.2015

That's not how it works. And for your goal the query should be:
PHP код:
SELECT COUNT(*) FROM players WHERE language