• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How do I migrated my database?

Tatuy

New Member
Joined
Jul 6, 2007
Messages
147
Reaction score
4
i buy one new host, and i need migrated my database,
i use PhpMyAdmin, look this:
helpc.png
 
Import the tables manually 1 by 1, from the dump (.sql) file.

@JDB, this is what I use on TFS 0.2:
Code:
function playerExists(name)
	dofile("./config.lua")
	env = assert(luasql.mysql())
	con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
	local cur = assert(con:execute("SELECT `name`, `id` FROM `players` WHERE `name` = '" .. escapeString(name) .. "';"))
	local row = cur:fetch({}, "a")
	cur:close()
	con:close()
	env:close()
	return row and row.name or 0
end
 
export/import all? why need to export by parts...

JDB

docs/lua functions?...


Code:
	//db table
	db.executeQuery(query)
	db.storeQuery(query)
	db.escapeString(str)
	db.escapeBlob(s, length)
	db.stringComparisonOperator()
	db.lastInsertId()

	//result table
	result.getDataInt(resId, s)
	result.getDataLong(resId, s)
	result.getDataString(resId, s)
	result.getDataStream(resId, s, length)
	result.next(resId)
	result.free(resId)
 
Back
Top