Raised This Month: $ Target: $400
 0% 

SQL Failure, not sure why


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Saturn SL1-WNY
Junior Member
Join Date: Dec 2004
Old 12-22-2004 , 02:18   SQL Failure, not sure why
Reply With Quote #1

Hello, I'm working with AMXX .20, and the Ultimate Warcraft3 Plugin. The guy hasn't released the source, nor updated, so that's what I have to use.

I'm trying to retrieve the XP # from the database, but so far I have not had luck in doing so.

Code:
public checkXP( id, key[] ) {     mySQLConnect()     if ( gMySQL <= SQL_FAILED) return false     new sql[512], error[128]     new Result:retvalxp     new parms[2]     new sqlxp[48]     server_print("[OMGKEY->] %s",key)     format(sql, 511, "SELECT xp FROM uwc3_xp WHERE steamid='%s'",key)     server_print("[OMGQUERY->] %s",sql)     retvalxp = dbi_query(gMySQL,sql)     if (retvalxp == RESULT_FAILED) {         dbi_error(gMySQL,error,127)         server_print("[SL-UWC3-LEVEL] MySQL XP Retrieval Error: %s",error)         return false     } else if (retvalxp == RESULT_NONE ) {         server_print("[SL-UWC3-LEVEL] This guy is new! Establishing minimum XP value... %s",retvalxp)         parms[0] = id         parms[1] = 0         set_task(5.0,"setXP",id,parms,2)         return true     }     server_print("[OMGRETVAL->] %d",retvalxp)     dbi_result(retvalxp, "xp", sqlxp, 32) // LINE 77     server_print("[OMGSQLXP->] %d %s",sqlxp,sqlxp)     if (sqlxp[32] < minxp ) {         gPlayerXP[id] = str_to_num("xp")         parms[0] = id         parms[1] = gPlayerXP[id]         set_task(5.0,"setXP",id,parms,2)         return true     }     dbi_free_result(retvalxp)         return true }

This is the subroutine.

Code:
[OMGKEY->] STEAM_0:1:4050101
[OMGQUERY->] SELECT xp FROM uwc3_xp WHERE steamid='STEAM_0:1:4050101'
[OMGRETVAL->] 9
L 12/22/2004 - 02:19:21: [AMXX] Native error in "dbi_result" on line 77 (plugin "sl_uw_minlevel.amxx").
L 12/22/2004 - 02:19:21: [MySQL] Unknown error
L 12/22/2004 - 02:19:21: [AMXX] Debug Trace =>
L 12/22/2004 - 02:19:21: [AMXX]       [0] Line 77, File "sl_uw_minlevel.sma"
L 12/22/2004 - 02:19:21: [AMXX]       [1] Line 155, File "sl_uw_minlevel.sma"
[OMGSQLXP->] 0

is what I get no matter how much XP I have in that person's field.

Line 155 simply calls the CheckXP with the person's SteamID which you can see is not a problem.

I've tried dbi_field / dbi_result , not sure what is going on . Executing the supplied query on the database works though.

Any ideas?
Saturn SL1-WNY is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-22-2004 , 03:18   Re: SQL Failure, not sure why
Reply With Quote #2

Quote:
Originally Posted by Saturn SL1-WNY
the Ultimate Warcraft3 Plugin. The guy hasn't released the source
Legally, he has to. :-)
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
mobytoss
Senior Member
Join Date: Jun 2004
Location: On my TS server
Old 12-22-2004 , 05:17  
Reply With Quote #3

Does he *have* to as in, everything he creates, has to be uploaded or whatever, 'cause that's a bit extreme. I thought it was more a case of not purposefully restricting code and ideas to stop others using them.

With the SQL, I dont see what's not happening. What exactly is the error? Is it compiling without any complaints?
__________________
"As we know, There are known knowns. There are things we know we know. We also know There are known unknowns. That is to say We know there are some things We do not know. But there are also unknown unknowns, The ones we don't know We don't know."
mobytoss is offline
Saturn SL1-WNY
Junior Member
Join Date: Dec 2004
Old 12-22-2004 , 14:06  
Reply With Quote #4

Yeah I got it to go I forgot dbi_nextrow

However I keep getting
[OMGSQLXP->] 50 2604010
as the result. Where is this other number coming from in front?

str_to_num fails it then because it can't convert that and I end up with
junk like :


[OMGGPLAYERXP->] ê
Saturn SL1-WNY is offline
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 12-22-2004 , 15:08  
Reply With Quote #5

What is on line 77?
__________________
twistedeuphoria 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 19:15.


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