Register for your free account! | Forgot your password?

You last visited: Today at 19:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Error on mysql_query

Discussion on Error on mysql_query within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2013
Posts: 4
Received Thanks: 0
Error on mysql_query

Hello, i've got an error on a query i placed in a quest.
I would like to receive some help if possible :P


Error on syserr:
Code:
SYSERR: Jul  1 06:23:23 :: RunState: LUA_ERROR: [string "pet_system"]:8: attempt to index field `duracao' (a nil value)
SYSERR: Jul  1 06:23:23 :: WriteRunningStateToSyserr: LUA_ERROR: quest pet_system.start click
Query on quest:
Code:
local tempo = get_time()
local query = mysql_query("SELECT duracao FROM pets WHERE nome='"..pc.get_name ().."' and pet=pet_info[1] ORDER BY duracao DESC LIMIT 1")
	if tempo > tonumber(query.duracao[1]) then
		notice("Text")
		notice("Text")
	else
MySQL function:
Code:
mysql_query = function(query)
    if not pre then
        local rt = io.open('CONFIG', 'r'):read('*all')
        pre = string.gsub(rt, '.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+', '-h%1 -u%2 -p%3 -D%4')
    end

    math.randomseed(os.time())

    local fi, t, out = 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{}
	os.execute('mysql '..pre..' --execute='..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]            = tonumber(b) or b
        out[t[1][a]]           = out[t[1][a]] or {}
        out[t[1][a]][i-1]      = tonumber(b) or b
    end) end
    return out
end
MySQL version installed on server: 5.5.31

Thanks in advance
Kzee!
Kzee is offline  
Old 07/02/2013, 17:39   #2
 
elite*gold: 0
Join Date: May 2013
Posts: 4
Received Thanks: 0
bump
Kzee is offline  
Reply


Similar Threads Similar Threads
mysql_query and item_proto
02/26/2013 - Metin2 Private Server - 11 Replies
Hi ! I was making a quest with mysql_query, to conect to refine_vnum in item_proto. quest melhorar begin state start begin when 20091.take with item.vnum() == 169 begin local a = select("Sírius", "Barão", "Sair") if a == 1 then mysql_query("UPDATE player.item_proto SET refine_item='270' WHERE vnum='169'")
PHP mysql_query Problem
02/06/2013 - Web Development - 4 Replies
Hat sich erledigt :D
Mysql_Query
01/27/2013 - Metin2 Private Server - 1 Replies
Hi, ich suche jemanden der mir mysql_query's schreiben kann. Ich würde auch geldlich entlohnen. Skype: samy02091997 MFG DarkNessWorld2
mysql_query hilfe ...
12/30/2012 - Metin2 Private Server - 1 Replies
Ich hab ein kleines Problem und zwar möchte Ich meine Dungeon GUI auf MySQL basierend machen allerdings möchte der Befehl nicht so ganz wie ich das möchte und das pisst mich schon so ein bisschen an... vielleicht könnt ihr mir weiterhelfen, der reload klappt problemlos die Query wird aber scheinbar nicht ausgeführt, bzw in der Datenbank wird kein Update ausgeführt. Die Query an sich funktioniert einwandfrei habe es unter MySQL Query in Navicat oft genug probiert, Questsehend schlägt...
Syntax Error bei einem Mysql_Query
12/15/2011 - Web Development - 1 Replies
hat sich erledtigt



All times are GMT +1. The time now is 19:38.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.