READ THE RULES
0 Members and 1 Guest are viewing this topic.
Are you kidding? Anyway you can use mysql through lua... use it if you need it
Please make support mysql and storage of the registered users in base. Very serious change and very necessary to all. Forgive for my English, work of the translator
At present there is no working library allowing to work with mysql for API2.
Why the project luaSQL so a long time was not updated?
Show me working library for work with mysql on ptokax 0.4.1.1
However, it would be easier, quicker and easier option to keep registered users and settings in the database
require "luasql.mysql"mysql = assert(luasql.mysql())db_name = "btit"db_host = "localhost"db_user = "btit"db_pass = "xxxxxxxxxx"con = assert(mysql:connect(db_name, db_user, db_pass, db_host)) cur = assert(con:execute("SELECT version()"))Core.SendToAll("<mysql> MYSQL server version is: "..cur:fetch())cur:close()Core.SendToAll("<mysql> MYSQL driver version is: "..luasql._MYSQLVERSION)Core.SendToAll("<mysql> "..luasql._COPYRIGHT)Core.SendToAll("<mysql> "..luasql._DESCRIPTION)Core.SendToAll("<mysql> "..luasql._VERSION)con:close()mysql:close()
[19:05:12] <mysql> MYSQL server version is: 5.0.51a-3ubuntu5.1[19:05:12] <mysql> MYSQL driver version is: 5.0.45[19:05:12] <mysql> Copyright (C) 2003-2007 Kepler Project[19:05:12] <mysql> LuaSQL is a simple interface from Lua to a DBMS[19:05:12] <mysql> LuaSQL 2.1.1[19:05:12] <PtokaX> *** ATAG started script: sql.lua
require "luasql.mysql"mysql = assert(luasql.mysql())db_name = "testdb"db_host = "localhost"db_user = "adm"db_pass = "****"con = assert(mysql:connect(db_name, db_user, db_pass, db_host))cur = assert(con:execute("SELECT version()"))Core.SendToAll("<mysql> MYSQL server version is: "..cur:fetch())cur:close()Core.SendToAll("<mysql> MYSQL driver version is: "..luasql._MYSQLVERSION)Core.SendToAll("<mysql> "..luasql._COPYRIGHT)Core.SendToAll("<mysql> "..luasql._DESCRIPTION)Core.SendToAll("<mysql> "..luasql._VERSION)con:close()mysql:close()
It will be harder, slower and using more resources.
than the record / opening files?
Even so, support for storing user registration would more closely unite hub + site or hub + forum
In the case of storage other *.xml files in the database could be very easy-to write adminpage for the hub, and remotely edit the settings.
It's possible to write a simple http server in Lua and manage the hub through it, but it's more simplier to use the PtokaX Remote Administration utility
local sqlite3 = require"pxsqlite3"