SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL (/showthread.php?tid=273858)



MySQL - [IL]HeHu - 03.08.2011

How do I caculate the amount of X I have
For example I have 200ids of houses created in the SQL database going like:
1
2
3
4
5
6
7
8
blablabla
How do I calculate the last ID, or the amount of IDs all together as in if I have 200 houses
It will give out: "200" or if i have 1 house it will give out "1"


Re: MySQL - Niixie - 03.08.2011

Give an example, but I'd say sizeof()?


Re: MySQL - [IL]HeHu - 03.08.2011

i already gave u an example, just how do you make the PAWN calculate how many houses are there in the SQL houses 'folder'
Just so whenever i create a house it updates the MAX_HOUSES array or something


Re: MySQL - Niixie - 04.08.2011

Do your query (insert or delete) house, when delete just -1, when insert +1. If you want a total, then make a query that selects everything, and see effected rows?


Re: MySQL - RyDeR` - 04.08.2011

Use:
pawn Код:
mysql_num_rows(MYSQL: handle);



Re: MySQL - Niixie - 04.08.2011

Quote:
Originally Posted by RyDeR`
Посмотреть сообщение
Use:
pawn Код:
mysql_num_rows(MYSQL: handle);
^Thats the best, mine doesn't really make sense when i think about it.