Jump to content

Sql printing error


Dumper

Recommended Posts

 

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)

ERoM3B.png

Link to comment

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...