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
Are you kidding? Anyway you can use mysql through lua... use it if you need it :)
At present there is no working library allowing to work with mysql for API2. I use api2 only because I use personal scripts which all are written 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
Quote from: ATAG on 09 October, 2008, 11:12:59
Are you kidding? Anyway you can use mysql through lua... use it if you need it :)
However, it would be easier, quicker and easier option to keep registered users and settings in the database ::)
Quote from: zigzagkms on 09 October, 2008, 08:15:10
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
If you want to have registered users in mysql you can do that from lua with LuaSQL library. I don't have any good reason to waste cpu and memory with storing them in database. It is not necessary and it is not needed by all (if that is not your name ;D).
Quote from: zigzagkms on 09 October, 2008, 13:02:06
At present there is no working library allowing to work with mysql for API2.
PtokaX lua api have nothing to do with external libs. Handling libs is part of lua base and PtokaX lua api don't change anything on that.
Quote from: zigzagkms on 09 October, 2008, 13:02:06
Why the project luaSQL so a long time was not updated?
You are asking on wrong place, you need to ask LuaSQL devs. Maybe it not need updates, last version is less than year old.
Quote from: zigzagkms on 09 October, 2008, 13:02:06
Show me working library for work with mysql on ptokax 0.4.1.1
As you want, screenshot attached 8)
Quote from: Fox_home on 09 October, 2008, 16:55:48
However, it would be easier, quicker and easier option to keep registered users and settings in the database ::)
It will be harder, slower and using more resources.
Quote from: zigzagkms on 09 October, 2008, 13:02:06Show me working library for work with mysql on ptokax 0.4.1.1
Here you are:
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()
Quote[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
1.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()
LuaSQL 2.1.1
MySQL 5.0.18-nt
msvcr80.dll (8.0.50727.42)
So has spread out files:
scripts\libs\luasql\mysql.dll
scripts\libs\libmysql.dll
msvcr80.dll
I struggled with it a lot of time, nothing turns out, help, what I do not so?
Result on a screenshot
Quote from: PPK on 09 October, 2008, 18:00:28
It will be harder, slower and using more resources.
Using the database 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 8)
Quote from: Fox_home on 11 October, 2008, 04:23:23
than the record / opening files?
Regs are on startup loaded to memory, stored in hash table and sometimes saved to file.. database must save data to file sometimes too :P
Quote from: Fox_home on 11 October, 2008, 04:23:23
Even so, support for storing user registration would more closely unite hub + site or hub + forum 8)
Again, you can store them in database if you want with lua script ::)
Assume there is a forum and want it to users to enter the hub of their login/pass and not to register again.
In such a case would have to edit the registration (on the forum) that data is also recorded in RegisteredUsers.xml?
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.
Quote from: Fox_home on 11 October, 2008, 11:04:17In 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 :)
Quote from: ATAG on 11 October, 2008, 11:38:27
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 :)
Thank you, I know about this method
I wanted to show that lisch hub with the support of MySQL will become even easier and more flexible.
Help me please why at me a mistake gives out, what at once have broken off that? And why to not make support ptokax a database mysql, but on a choice of the user, wants let stores in files, and wants let uses mysql?
I tried to use mysql on the gui version (with wine) and got just error "modul not found". I have no idea what's the problem, maybe the Lua5.1 incompatibility because it use the compat options to load the lua libs...
Decisions of a problem at present do not exist? Except for as refusal of work on a platform windows. The embodiment of idea about ptokax mysql means most ptokax will not be?