Register for your free account! | Forgot your password?

You last visited: Today at 16:44

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

Advertisement



Metin2 lua query

Discussion on Metin2 lua query within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2009
Posts: 55
Received Thanks: 7
Metin2 lua query

Code:
function query(sql)
	user = "mt2"
	pw = "mt2!@#"
	local var = {}
	var.pre = ''
	if user ~= nil then
	var.pre = var.pre..' -u'..user
	end
	if pw ~= nil then
	var.pre = var.pre..' -p'..pw
	end
	var.scriptfile = 'sc_'..pc.get_name()..number(1,999)..number(2,999)..number(3,999)
	var.outputfile = 'op_'..pc.get_name()..number(1,999)..number(2,999)..number(3,999)
	sql = string.gsub(sql,'"',"'")
	var.str = "/usr/local/bin/mysql -N -L "..var.pre.." < "..var.scriptfile.." > "..var.outputfile
	script = io.open(var.scriptfile,"a+")
	script:write(sql)
	script:close()
	os.execute(var.str)
	back = io.open(var.outputfile)
	quer = back:read()
	back:flush()
	back:close()
	os.remove(var.scriptfile)
	os.remove(var.outputfile)
	return quer
end
This is my function to use mysql with localhost mysql.

How to use query with external host mysql?

using other IP?
dramcio is offline  
Old 09/08/2012, 20:41   #2

 
Apocalyptum's Avatar
 
elite*gold: 55
Join Date: Aug 2011
Posts: 1,459
Received Thanks: 563
i guess its not possible o.o
otherwise why do you need it? localhost is more safety as a extern host i guess
Apocalyptum is offline  
Old 09/08/2012, 21:08   #3
 
elite*gold: 0
Join Date: May 2009
Posts: 55
Received Thanks: 7
I need to connect with extain host to insert some thing

/// I can open other website (etc. cron) but from quest. i don't have apache on my freebsd.

how?
dramcio is offline  
Old 09/08/2012, 21:11   #4
 
Mijago's Avatar
 
elite*gold: 191
Join Date: May 2009
Posts: 1,214
Received Thanks: 2,597
mysql -h123.456.789 -x -y -bla

Type this and read : man mysql
Mijago is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
Metin2 Kann keine Query´s einfügen..!
08/23/2011 - Metin2 Private Server - 2 Replies
Hallo epvp.... Ich habe das Problem das ich einfach keine Query´s richtig einfügen kann Ich wolte die neuen 2011er waffen einfügen, So füge ich sie ein... Player -> item_proto -> File -> Query Table -> dan in die Zweite zeile und den Query einfügen und auf run klicken... aber bei mir Laden die Waffen nicht...Sobald ich auf Run laden die waffen nichtmal sondern es ist sofort nach dem ich auf Run geklickt habe Fertig... Und kann die dan auch nicht einfügen ....
[Suche]Query für "Alteklinge, Reichsklinge" &' Stichdolche NUR QUERY!
08/18/2010 - Metin2 Private Server - 1 Replies
Ich weiß ich werd nervig aber ich suche die Query's für Alteklinge, Reichsklinge &' Strichdolche Why? Naya, weil ich in der DB i-wie nur Drachenmaulglocke hab ... not more -.- Auf jeden Fall Icon's etc. etc. etc. hab ich ich brauche nur die Query's



All times are GMT +1. The time now is 16:44.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.