AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reading data with SQLx (https://forums.alliedmods.net/showthread.php?t=136170)

ghostdlr 08-23-2010 15:29

Reading data with SQLx
 
How can I read data from a particular column with SQLx (the query returns only one row) ?

minato 08-23-2010 15:31

Re: Reading data with SQLx
 
SQL_ReadResult(query,col)

ghostdlr 08-23-2010 15:42

Re: Reading data with SQLx
 
I've tried this already :
new Data
Data = SQL_ReadResult(Query, 0)
server_print("Value: %s",Data)

It prints out integers (%d) but I don't know how to do this for strings
%s is for strings in amxmodx, right ?

minato 08-23-2010 16:10

Re: Reading data with SQLx
 
PHP Code:

new szBuffer[32]
SQL_ReadResult(query,0,szBuffer,sizeof(szBuffer) - 1)
server_print("Value: %s",szBuffer


ghostdlr 08-23-2010 16:18

Re: Reading data with SQLx
 
It works. Thanks .


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

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