AlliedModders

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

raggarlasse 09-08-2013 23:47

SQL -Count rows
 
Hello, I need some help with some code.
I want to count the rows that equals a specific steamId.

This is what I've tried :
Code:

formatex(szTemp,charsmax(szTemp),"SELECT * FROM `log` WHERE Player = '%s'", szSteamId)
        SQL_ThreadQuery(g_SqlTuple, "returnValue",szTemp,Data,1);

returnValue
Code:

new asdf
        asdf=SQL_NumResults(Query)


Another idea how to solve this is to return the value of this string
Code:

SELECT COUNT(Player) FROM log WHERE Player = 'STEAM_0:0:19289143'

But what I want is a variable with the number of rows, a specific steamid appears in.

YamiKaitou 09-09-2013 00:15

Re: SQL -Count rows
 
So use the query with Count and read the value. I don't get the question

raggarlasse 09-09-2013 11:31

Re: SQL -Count rows
 
Quote:

Originally Posted by YamiKaitou (Post 2031130)
So use the query with Count and read the value. I don't get the question

Im pretty new to pawn and sql. How do I read the result? I've tried SQL_ReadResult(Query,0) but only getting 0.


All times are GMT -4. The time now is 19:13.

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