Jump to content

Mysql error


Recommended Posts

  • Premium
mysql: ambiguous option '--e=SELECT coins from account.account WHERE id=3 LIMIT 1;' (enable_cleartext_plugin, execute) 

How i can resolve it? I have a quest that require mysql_query:

quest mds begin
    state start begin
        when login begin
            loop_timer("carga_mds", 10)
        when carga_mds.timer begin
            local coins = mysql_query("SELECT coins from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
            cmdchat("Mds "..coins)

My mysql_query of questlib.lua:

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') 
    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, 
        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 
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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

  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.