Raised This Month: $ Target: $400
 0% 

SQL -Count rows


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raggarlasse
New Member
Join Date: Aug 2013
Old 09-08-2013 , 23:47   SQL -Count rows
Reply With Quote #1

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.

Last edited by raggarlasse; 09-08-2013 at 23:48.
raggarlasse is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-09-2013 , 00:15   Re: SQL -Count rows
Reply With Quote #2

So use the query with Count and read the value. I don't get the question
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
raggarlasse
New Member
Join Date: Aug 2013
Old 09-09-2013 , 11:31   Re: SQL -Count rows
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
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.
raggarlasse is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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