Problem with MySql Quest Conection.

07/05/2013 21:56 pepineitor#1
Hi guys, today when i'm starting the new dedicated, when i use the ingame ranking, i saw that did not work, and in the putty appeared the error:
Code:
 ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=SELECT name, level,pvp_puntos_noguerra FROM player.player WHERE name not like '' at line 1
In my Vbox server, the system runs :! i use the mijago mysql_query system:
Code:
mysql_query = function(query)
    local rt = io.open('CONFIG','r'):read('*all')
    local pre= string.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4')
    math.randomseed(os.time())
    local fi,t,out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
    os.execute('mysql '..pre..' -e='..string.format('%q',query)..' > '..fi)   
    for av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) end; os.remove(fi);
    for i = 2, table.getn(t) do table.foreach(t[i],function(a,b)
            out[i-1]        = out[i-1] or {}
            out[i-1][a]     = b
            out[t[1][a]]    = out[t[1][a]] or {}
            out[t[1][a]][i-1]    = b
    end) end
    return out
end
And the MySql version are: 5.5.32.

PD, the quest is this:
Code:
quest rank begin
	state start begin
		when 20351.chat."Rankin" begin
			local sel=mysql_query("select name, level,exp from player.player WHERE name not like '[%' ORDER BY LEVEL desc LIMIT 15;")
			say_lightblue(" #   | Name | Level | Exp.")
			table.foreachi(sel,function(i,l)
			say_blue("# "..i.."  |  "..l[1].."  |  Lv."..l[2].."  |  "..l[3])
			end)
		end
	end
end
No generate syserr errors.

Does anyone know how you can fix this error?
Greetings!.

Anyone?