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

SQL_IsNull not working.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 11-03-2008 , 20:44   SQL_IsNull not working.
Reply With Quote #1

After some tests, I found out SQL_IsNull of SQLX always returns 0. I want to confirm this behavior before sending a bug report. Partial code.

BAN NULL always prints, and I can confirm the column is null by executing the same exact query manually.

PHP Code:
public client_authorized(id)
{
    static 
szAuth[36]
    
get_user_authid(idszAuthcharsmax(szAuth))
    
    static 
szQuery[384]
    
formatex(szQuerycharsmax(szQuery),
        
"SELECT t1.id, online, username, points, admin_flags, ban_reason, (premium_end > NOW()) \
        FROM users AS t1 LEFT OUTER JOIN bans AS t2 \
        ON t1.id = t2.premium_id \
        AND (ban_length=0 OR (timestamp + INTERVAL ban_length MINUTE) >= NOW()) \
        AND auth_cs16='%s'"
szAuth )
    
    new 
iData[1]
    
iData[0] = id
    
    SQL_ThreadQuery
(g_hSQLTuple"User_CheckAuth_QueryHandler"szQueryiData1)
}

public 
User_CheckAuth_QueryHandler(iStateHandle:hQueryszErroriErrNumiData[], iDataSizeFloat:fTime)
{
    
// .... 
    
else if(!SQL_IsNull(hQuery,colBanReason))
    {
        
server_print("BAN NULL")
        
SQL_ReadResult(hQuerycolBanReasonszKickReasoncharsmax(szKickReason))
    }

__________________

Community / No support through PM
danielkza is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 11-04-2008 , 06:36   Re: SQL_IsNull not working.
Reply With Quote #2

which value has colBanReason?
depending on your SELECT it must be 5
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who don´t.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 11-04-2008 , 11:09   Re: SQL_IsNull not working.
Reply With Quote #3

Quote:
Originally Posted by |PJ| Shorty View Post
which value has colBanReason?
depending on your SELECT it must be 5
PHP Code:
enum
{
    
colID 0,
    
colOnline,
    
colUsername,
    
colPoints,
    
colAdminFlags,
    
colBanReason,
    
colPremiumEnd

__________________

Community / No support through PM
danielkza is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 11-04-2008 , 11:55   Re: SQL_IsNull not working.
Reply With Quote #4

seems to be a bug then. i never used this function in my plugins.
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who don´t.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
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 00:48.


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