determinate determinate

Author Topic: Support mysql in new ptokax  (Read 2433 times)

0 Members and 1 Guest are viewing this topic.

Offline zigzagkms

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-3
Support mysql in new ptokax
« on: October 09, 2008, 08:15:10 am »
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

Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 106
  • Karma: +13/-0
Re: Support mysql in new ptokax
« Reply #1 on: October 09, 2008, 11:12:59 am »
Are you kidding? Anyway you can use mysql through lua... use it if you need it :)
« Last Edit: October 09, 2008, 11:54:45 am by ATAG »

Offline zigzagkms

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-3
Re: Support mysql in new ptokax
« Reply #2 on: October 09, 2008, 01:02:06 pm »
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

Offline Fox_home

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-1
  • Drunken Russian Bear
Re: Support mysql in new ptokax
« Reply #3 on: October 09, 2008, 04:55:48 pm »
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  ::)

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 245
  • Karma: +206/-17
  • PtokaX "developer"
Re: Support mysql in new ptokax
« Reply #4 on: October 09, 2008, 06:00:28 pm »
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).
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.
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.
Show me working library for work with mysql on ptokax 0.4.1.1
As you want, screenshot attached 8)
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.

Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 106
  • Karma: +13/-0
Re: Support mysql in new ptokax
« Reply #5 on: October 09, 2008, 07:05:35 pm »
Show me working library for work with mysql on ptokax 0.4.1.1
Here you are:
Code: [Select]
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

Offline zigzagkms

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-3
Re: Support mysql in new ptokax
« Reply #6 on: October 10, 2008, 06:55:34 am »
1.lua:
Code: (lua) [Select]
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

Offline Fox_home

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-1
  • Drunken Russian Bear
Re: Support mysql in new ptokax
« Reply #7 on: October 11, 2008, 04:23:23 am »
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)
« Last Edit: October 11, 2008, 04:26:04 am by Fox_home »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 245
  • Karma: +206/-17
  • PtokaX "developer"
Re: Support mysql in new ptokax
« Reply #8 on: October 11, 2008, 10:16:09 am »
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
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 ::)

Offline Fox_home

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-1
  • Drunken Russian Bear
Re: Support mysql in new ptokax
« Reply #9 on: October 11, 2008, 11:04:17 am »
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.
« Last Edit: October 11, 2008, 11:06:52 am by Fox_home »

Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 106
  • Karma: +13/-0
Re: Support mysql in new ptokax
« Reply #10 on: October 11, 2008, 11:38:27 am »
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 :)

Offline Fox_home

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-1
  • Drunken Russian Bear
Re: Support mysql in new ptokax
« Reply #11 on: October 11, 2008, 12:19:05 pm »
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.

Offline zigzagkms

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-3
Re: Support mysql in new ptokax
« Reply #12 on: October 12, 2008, 03:56:23 pm »
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?

Offline ATAG

  • Scripter
  • Double Ace
  • ******
  • Posts: 106
  • Karma: +13/-0
Re: Support mysql in new ptokax
« Reply #13 on: October 12, 2008, 11:45:39 pm »
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...

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: Support mysql in new ptokax
« Reply #14 on: October 13, 2008, 12:49:55 am »
We have quietly tiptoed around the fact that the
extension for windows [PXSQLite3.dll] is busted.
Although the module may be loaded,
Code: [Select]
local sqlite3 = require"pxsqlite3"many crucial functions fail. There were issues
on previous builds for the original Px API as well.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

Offline zigzagkms

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-3
Re: Support mysql in new ptokax
« Reply #15 on: October 14, 2008, 08:20:46 am »
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?

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: Support mysql in new ptokax
« Reply #16 on: October 18, 2008, 08:01:13 pm »
Your translator sucks...   :)
We can only guess what your point might be.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

 

determinate determinate