got a num of row in mysql - 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: got a num of row in mysql (
/showthread.php?tid=507582)
get a number of row in mysql -
TakeAllEasy - 18.04.2014
i work on a clan system, and i want to set id for clans. and i want to got the number of the row in my sql.
if the table is like this:
Clan1 5
Clan2 3
Clan3 4
Clan4 1
so i want to got the number of row where ClanName = Clan2 for exemple.
the number need to be 1/2
sorry about the bad english.
Re: got a num of row in mysql -
TakeAllEasy - 19.04.2014
someone?
Re : got a num of row in mysql -
Ramoboss - 19.04.2014
here's an exemple :
pawn Код:
mysql_query("SELECT NULL FROM table1");
mysql_store_result();
new rows = mysql_num_rows();
mysql_free_result();
printf("There are %d rows in table1",rows);
Re: Re : got a num of row in mysql -
TakeAllEasy - 19.04.2014
Quote:
Originally Posted by Ramoboss
here's an exemple :
pawn Код:
mysql_query("SELECT NULL FROM table1"); mysql_store_result(); new rows = mysql_num_rows(); mysql_free_result(); printf("There are %d rows in table1",rows);
|
tanks buy its dont what i mean.
i want to got the number of a spesipic row.
Re : got a num of row in mysql -
Ramoboss - 19.04.2014
dude, you have to replace table1 by the table of your clan, and you get the number of the rows in this table