Raised This Month: $ Target: $400
 0% 

Sql name problem...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-02-2012 , 21:16   Sql name problem...
Reply With Quote #1

Code:
public client_disconnect(id) {     if(solorun == true)     {         if(id == soloid && is_user_alive(soloid)) // Didn't die         {             new name[32]             get_user_name(soloid, name, 31)     // Solo Gunner name             replace_all(name,31,"'","")             replace_all(name, 31, "^"", "")             //formatex(selectquery, 255, "USE %s", db)             //SQL_ThreadQuery(sql, "query", selectquery)             formatex(g_query, 511, "UPDATE played_time SET playedtime=playedtime-%d WHERE name=^"%s^"", get_pcvar_num(g_Ddisconnect) , name)             SQL_ThreadQuery(sql,"query", g_query)             remove_task(soloid)             return PLUGIN_HANDLED         }         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED }
I'm trying to make a bonus time plugin for played time plugin, the problem is the name, I can't get the name correctly, I tried to comment these 2 lines (the ones that are highlighted) and the name worked perfectly, but as for SQL, I must remove these characters ' & ^, and I don't know how to solve it.
Could someone post an explanation of what's wrong, and how to fix it, if possible?
PS: I took these two lines from the played time plugin.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 07-03-2012 at 07:24.
pokemonmaster 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 15:25.


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