MYSQL QUERY - 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 QUERY (
/showthread.php?tid=415523)
MYSQL QUERY -
audriuxxx - 13.02.2013
Hi,
SELECT * FROM gangsteritory WHERE uzimta = '2'
I want to get all fields, i want count them, all tables, where uzimta is 2.
Re: MYSQL QUERY -
Benjo - 13.02.2013
I'm not sure if I have interpreted the question correctly, but I'm guessing you want to count how many results that mysql query will give you? If so, I would use the following method:
pawn Код:
mysql_query("SELECT * FROM gangsteritory WHERE uzimta = '2'");
mysql_store_result();
new resultcount = mysql_num_rows();
The amount of results is store into the variable resultcount.
If I've got the wrong idea, I'm very sorry!
Re: MYSQL QUERY -
audriuxxx - 13.02.2013
I like in my db like that:
uzimta = 1
uzimta = 1
uzimta = 1
uzimta = 1
uzimta = 2
uzimta = 2
uzimta = 2
uzimta = 2
uzimta = 2
Then i want to know how much uzimta is inserted in db where uzimta is 2, now it's 4 in my example