Raised This Month: $51 Target: $400
 12% 

[HELP] SQLx


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 09-20-2012 , 05:16   [HELP] SQLx
Reply With Quote #1

PHP Code:
public Load_MySql(id)
{
    new 
szSteamId[32], szTemp[512]
    
get_user_authid(idszSteamIdcharsmax(szSteamId))
    
    new 
Data[1]
    
Data[0] = id
    
    format
(szTemp,charsmax(szTemp),"SELECT skill, nick FROM %s WHERE steamID = '%s'",Table,Table,szSteamId)
    
SQL_ThreadQuery(g_SqlTuple,"register_client",szTemp,Data,1)
}

public 
register_client(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
    if(
FailState == TQUERY_CONNECT_FAILED)
    {
        
log_amx("Load - Could not connect to SQL database.  [%d] %s"ErrcodeError)
    }
    else if(
FailState == TQUERY_QUERY_FAILED)
    {
        
log_amx("Load Query failed. [%d] %s"ErrcodeError)
    }
    
    new 
id
    id 
Data[0]
    
    if(
SQL_NumResults(Query) < 1
    {
        
client_print(idprint_chat"hsaeiasurkahe")
    } 
    else 
    {
        
Skillid ] = SQL_ReadResultQuery)
        
nickid ] = SQL_ReadResultQuery)
    }
    
    return 
PLUGIN_HANDLED

So, this is not working. Any suggest? :/

EDIT* It doesn't load neither skill, or nick.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG

Last edited by quark; 09-20-2012 at 05:18. Reason: plus
quark is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-20-2012 , 05:22   Re: [HELP] SQLx
Reply With Quote #2

PHP Code:
format(szTemp,charsmax(szTemp),"SELECT skill, nick FROM %s WHERE steamID = '%s'",Table,Table,szSteamId
->

PHP Code:
format(szTemp,charsmax(szTemp),"SELECT skill, nick FROM %s WHERE steamID = '%s'",Table,szSteamId
__________________
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).

Last edited by YamiKaitou; 09-20-2012 at 05:22.
YamiKaitou is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 09-20-2012 , 05:25   Re: [HELP] SQLx
Reply With Quote #3

F*cking stupid errors -.-'

Doesn't work anyway :/
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-20-2012 , 05:33   Re: [HELP] SQLx
Reply With Quote #4

Is the data you are trying to obtain strings or numbers? The way you have it coded is as if they were numbers.

How about any error messages? Are you sure the query is even being executed correctly and there actually is valid data in the database?
__________________
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
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 09-20-2012 , 05:42   Re: [HELP] SQLx
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
Is the data you are trying to obtain strings or numbers? The way you have it coded is as if they were numbers.
Nick are letters, but skill are numbers.

Quote:
Originally Posted by YamiKaitou View Post
How about any error messages? Are you sure the query is even being executed correctly and there actually is valid data in the database?
Yes, in the database is everything ok.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG

Last edited by quark; 09-20-2012 at 05:42.
quark is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-20-2012 , 05:47   Re: [HELP] SQLx
Reply With Quote #6

SQL_ReadResult
__________________
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).

Last edited by YamiKaitou; 09-20-2012 at 05:48.
YamiKaitou is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 09-20-2012 , 06:07   Re: [HELP] SQLx
Reply With Quote #7

Thank you btw.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 09-20-2012 , 06:50   Re: [HELP] SQLx
Reply With Quote #8

F*ck this. I can't figure out how to do it
__________________

Check out My Plugins:
qServerInfo ; ASKTAG
quark is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-20-2012 , 09:42   Re: [HELP] SQLx
Reply With Quote #9

Did you take a look at what Yami posted?
PHP Code:
SQL_ReadResult(Query1nick[id], 31); 
i assume that nick[] it's a string and it's properly declared. Replace 31 with your string size...
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 09-20-2012 at 11:09.
Alka is offline
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 09-21-2012 , 05:14   Re: [HELP] SQLx
Reply With Quote #10

SOLVED

MY Solution:
PHP Code:
format(szTemp,charsmax(szTemp),"SELECT `nick` FROM `%s` WHERE `steamID` = '%s'",Table,szSteamId)

SQL_ReadResult(Query0nick[id], 32
__________________

Check out My Plugins:
qServerInfo ; ASKTAG

Last edited by quark; 09-21-2012 at 05:17.
quark is offline
Reply



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:17.


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