Raised This Month: $ Target: $400
 0% 

Solved [MySQL] Return function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
wilian159
Member
Join Date: Dec 2013
Old 01-08-2022 , 23:09   [MySQL] Return function
Reply With Quote #1

is there any way i can return integer values or text according to a query?


we usually do this

PHP Code:
public SqlGetUserIndex(id)
{
    
SQL_ThreadQuery(handle"_SqlGetUserIndex""SELECT id FROM users WHERE authid = 'STEAM_XXXXXXXX'")
}

public 
_SqlGetUserIndex(fail_stateHandle:queryerror[], error_codedata[], data_size)
{
    
// check fails, etc....

    
new id

    
if(SQL_NumResults(query))
    {
        
id SQL_ReadResult(xQuery0)
    }
    else
    {
        
id = -1
    
}

I wanted to do something like that.:

return straight into function

PHP Code:
public SqlGetUserIndex(id)
{
    
SQL_ThreadQuery(handle"XXXXXX""SELECT id FROM users WHERE authid = 'STEAM_XXXXXXXX'")

    new 
id

    
if(SQL_NumResults(query))
    {
        
id SQL_ReadResult(xQuery0)
    }
    else
    {
        
id = -1
    
}

    return 
id


like

PHP Code:
new user_id SqlGetUserIndex(id)
out
there must be a way? or it is not possible to do this at the moment.
__________________

Last edited by wilian159; 01-09-2022 at 12:10.
wilian159 is offline
 


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 11:44.


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