Dumper Posted August 25, 2017 Share Posted August 25, 2017 What is the problem with this system ? Why is not sql writing? mysql = exports.mysql function setetiket(thePlayer, commandName, targetPlayerName, etiketLevel) local targetName = exports.global:getPlayerFullIdentity(thePlayer, 1) if exports.integration:isPlayerLeadAdmin(thePlayer) then if not targetPlayerName or not tonumber(etiketLevel) then outputChatBox("Kullanım: #ffffff/" .. commandName .. " [İsim/ID] [VİP]", thePlayer, 255, 194, 14, true) else local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick( thePlayer, targetPlayerName ) if not targetPlayer then elseif getElementData( targetPlayer, "loggedin" ) ~= 1 then outputChatBox( "Player is not logged in.", thePlayer, 255, 0, 0 ) else mysql:query_free("UPDATE `characters` SET `etiket`="..mysql:escape_string(etiketLevel)..", WHERE `id`='"..mysql:escape_string(getElementData(targetPlayer, "dbid")).."'") setElementData(targetPlayer, "etiket", tonumber(etiketLevel)) outputChatBox("[!]#ffffff".. targetPlayerName .. " adlı kişinin vip seviyesini " .. etiketLevel .. " yaptın.", thePlayer, 0, 255, 0, true) outputChatBox("[!]#ffffff"..targetName.." tarafından vip seviyeniz " .. etiketLevel .. " yapıldı.", targetPlayer, 0, 255, 0,true) end end else outputChatBox( "[!]#ffffffBu işlemi yapmaya yetkiniz yok.", thePlayer, 255, 0, 0, true) end end addCommandHandler("etiketver", setetiket) Link to comment
Dimos7 Posted August 25, 2017 Share Posted August 25, 2017 the problem i think will be at your mysql Link to comment
3aGl3 Posted August 25, 2017 Share Posted August 25, 2017 I think it's the comma in front of the where, so the mysql query line should be like this instead: mysql:query_free("UPDATE `characters` SET `etiket`="..mysql:escape_string(etiketLevel).." WHERE `id`='"..mysql:escape_string(getElementData(targetPlayer, "dbid")).."'") Link to comment
Dumper Posted August 26, 2017 Author Share Posted August 26, 2017 17 hours ago, 3aGl3 said: I think it's the comma in front of the where, so the mysql query line should be like this instead: mysql:query_free("UPDATE `characters` SET `etiket`="..mysql:escape_string(etiketLevel).." WHERE `id`='"..mysql:escape_string(getElementData(targetPlayer, "dbid")).."'") Thank You Bro <3 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now