AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SQLx Read data from a SQL query... (https://forums.alliedmods.net/showthread.php?t=49327)

SweatyBanana 01-01-2007 22:11

SQLx Read data from a SQL query...
 
I talked to bail on IRC, but didn't really understand what he meant.. He said to use SQL_ReadResult, but I do not understand how to actually pick something out of the SQL table without knowing the value beforehand.

Look:

Code:

SQL_PrepareQuery(SqlConnection,"SELECT * FROM Points WHERE playerID = '0'")
But how do I just check the value of playerID?

gxti 01-01-2007 22:36

Re: SQLx Read data from a SQL query...
 
Quote:

Originally Posted by SweatyBanana (Post 422599)
I talked to bail on IRC, but didn't really understand what he meant.. He said to use SQL_ReadResult, but I do not understand how to actually pick something out of the SQL table without knowing the value beforehand.


First off, what are you trying to accomplish? Get the playerID given some other column's value? Get all playerIDs in the table?

SweatyBanana 01-01-2007 22:43

Re: SQLx Read data from a SQL query...
 
There is only going to be one playerID value.. It will increase every time someone enters any one of the servers. It is like the #userid in game.

It will be overwritten.

I just need to check the value of it..

I think a general query would be something like this:

Code:

SQL_PrepareQuery(SqlConnection,"SELECT * FROM Points")
but how would I pull one value?

SweatyBanana 01-02-2007 01:54

Re: SQLx Read data from a SQL query...
 
Hawk answered my question.


Anyway, new question!

If I want to get and set the same INT in client_putinserver, would I have to make two completely different queries or what?


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

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