A simple query for get total user in Mysql database
Hello Guys,
I begin with sourcepawn and i'm building a script for learning, my plugins is working fine, but now i try to use mysql, i can connecte but after is too hard for me. I'm searching and reading all about "sourcepawn" and mysql but after many days without success i need help. I juste want count if a user is existing in my base, like : PHP Code:
PHP Code:
https://forums.alliedmods.net/showthread.php?t=262795 This is my code, it work but i got always "1": PHP Code:
i'm totally desperat, i'm trying since 4 days night and day (really) for learn, but here i'm lost ! Thanks for all help guys, i do my best i'm sorry but it's new for me :) |
Re: A simple query for get total user in Mysql database
SQL_GetFieldCount returns the FIELDS not the rows
use SQL_GetRowCount |
Re: A simple query for get total user in Mysql database
Quote:
Hello Nexd, thanks for your help but i already did it, same result, i got only "1" I think here i need to make a while/for and count any row ? this is my code now : PHP Code:
|
Re: A simple query for get total user in Mysql database
its because you have a single result with count function from SQL, you need to fetch the first column
try with: PHP Code:
|
Re: A simple query for get total user in Mysql database
Quote:
May be need somthing more on top of the file ? (DEFINE ? or in plugins start ? lib ? (SDKtools, sdkhook ?)) I really don't understand why is to hard ? in PHP it's easy :shock: Thanks |
Re: A simple query for get total user in Mysql database
well its because you need to fetch it with a if or a while
PHP Code:
|
Re: A simple query for get total user in Mysql database
Quote:
very very very thanks for all help guys, i hope this post will help others. i will change to "solved" Thanks again aleeexxx :wink: |
Re: A simple query for get total user in Mysql database
Quote:
|
All times are GMT -4. The time now is 21:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.