Not a member yet? Register for your free account!


You last visited: Today at 11:27

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

 

Metin2 lua query

This is a discussion on Metin2 lua query within the Metin2 PServer - Discussions / Questions forum part of the Metin2 category; Code: function query(sql) user = "mt2" pw = "mt2!@#" local var = {} var.pre = '' if user ~= nil ...

Reply
 
Thread Tools
Old 09-08-2012, 20:33   #1
Member
 
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
Inaktiv
 
Join Date: Aug 2011
Posts: 1,234
Received Thanks: 521
Blog Entries: 1
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
Member
 
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
*.*Kenan & Mijago*.*
 
Join Date: May 2009
Posts: 1,151
Received Thanks: 2,130
Blog Entries: 2
mysql -h123.456.789 -x -y -bla

Type this and read : man mysql
Mijago is offline  
Thanks
2 Users
Apocalyptum (09-08-2012), dramcio (09-09-2012)
Reply

 

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metin2 Kann keine Query´s einfügen..! eXelence Metin2 PServer - Discussions / Questions 2 08-23-2011 16:42
[Suche]Query für "Alteklinge, Reichsklinge" &' Stichdolche NUR QUERY! VeN. Metin2 PServer - Discussions / Questions 1 08-18-2010 02:34



All times are GMT +2. The time now is 11:27.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.