AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Return rows (https://forums.alliedmods.net/showthread.php?t=141046)

Kiske 10-18-2010 22:19

Return rows
 
What consulte must be done in a plugin to give me back the number of rows that were obtained ?.

Example in PhpMyAdmin:
PHP Code:

SELECT `nick`, `d4FROM `table6ORDER BY `d4DESC

Showing rows 0 - 29 (1,499 total, Query took 0.0191 sec)

This number: 1,499
How do get in a Plugin ?.


Sory for my english.

Exolent[jNr] 10-18-2010 22:29

Re: Return rows
 
If you execute that query, you can just use SQL_NumResults().

Kiske 10-18-2010 22:36

Re: Return rows
 
Thanks, i did not think. :mrgreen:

Hunter-Digital 10-19-2010 00:17

Re: Return rows
 
Or if you ONLY want to get the number of rows and not the values, this will be more efficient:
Code:

SELECT COUNT(*) FROM `table6`

Kiske 10-19-2010 08:27

Re: Return rows
 
Quote:

Originally Posted by Hunter-Digital (Post 1329031)
Or if you ONLY want to get the number of rows and not the values, this will be more efficient:
Code:

SELECT COUNT(*) FROM `table6`

Yes, thanks again.


All times are GMT -4. The time now is 10:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.