Raised This Month: $ Target: $400
 0% 

SQL help needed for plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
slurpycof
Senior Member
Join Date: Nov 2004
Old 02-21-2005 , 10:54   SQL help needed for plugin
Reply With Quote #1

I wrote a map vote plugin that works great on my server using a local MySQL database. People posted that it would create the table for them, but that the results would not get added to the database. I used an external database from a website to test the plugin and I am getting the same results as they are. It creates the database and when the vote is it done, I am getting the "[AMXX] sql_mapvote results added to database" added to the logs, but the data is not added to the database. It is only happening on remote databases. Is there something I can do to make this work?


Code:
public sql_insert() {     if (dbc == SQL_FAILED) return PLUGIN_CONTINUE     new mapname[33]     get_mapname(mapname,32)     new totalint     totalint = floatround(total)     //Insert map information into the tables     result = dbi_query(dbc,"INSERT INTO maprank2 (map_name, good, okay, bad, total) values ('%s',%i,%i,%i,%i) ON DUPLICATE KEY UPDATE map_name=map_name, good=good+%i, okay=okay+%i, bad=bad+%i, total=total+%i",mapname,state[0],state[1],state[2],totalint,state[0],state[1],state[2],totalint)     if (result < RESULT_NONE) {         new err[255]         new errNum = dbi_error(dbc, err, 254)         log_amx("[AMXX] sql_mapvote error: %s|%d", err, errNum)         server_print("[AMXX] sql_mapvote error: %s|%d", err, errNum)         return 1     }else{         log_amx("[AMXX] sql_mapvote results added to database")     }     dbi_free_result(result)     return PLUGIN_CONTINUE  }
________
QR50

Last edited by slurpycof; 01-19-2011 at 05:01.
slurpycof is offline
 



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 14:09.


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