Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] connecting to mysql using lua


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
nik.middleton at noble...
Guest





PostPosted: Sun Feb 08, 2009 5:44 pm    Post subject: [Freeswitch-users] connecting to mysql using lua Reply with quote

Hi Guys

I want to access Mysql 5 from lua. The wiki is not too clear on this. Do I need to install lua and lua mysql?

Regards
Back to top
msc at freeswitch.org
Guest





PostPosted: Sun Feb 08, 2009 6:28 pm    Post subject: [Freeswitch-users] connecting to mysql using lua Reply with quote

Nik,


I see your point about the wiki entry regarding luasql. If someone could clarify then I will be happy to help get the wiki documentation updated appropriately.


-MC

Sent from my iPhone

On Feb 8, 2009, at 2:41 PM, "Nik Middleton" <nik.middleton@noblesolutions.co.uk (nik.middleton@noblesolutions.co.uk)> wrote:



Quote:

Hi Guys

I want to access Mysql 5 from lua. The wiki is not too clear on this. Do I need to install lua and lua mysql?

Regards


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Back to top
javieraristizabal at g...
Guest





PostPosted: Mon Feb 09, 2009 10:06 am    Post subject: [Freeswitch-users] connecting to mysql using lua Reply with quote

Hi. Well you need to install luasql, and work only with lua 5.0 or major.

You need a ODBC connection to MySQL.

And there is an lua script example:
============================================================
#!/usr/local/bin/lua
require "luasql.mysql"

env = assert (luasql.mysql())
con = assert (env:connect("DB","user","password","localhost))
cur = assert (con:execute"SELECT id, name FROM test")
row = cur:fetch ({}, "a")
while row do
print(string.format("Id: %s, Name: %s", row.id, row.name))
-- reusing the table of results
row = cur:fetch (row, "a")
end



cur:close()
con:close()
env:close()
==========================================================

regards
javar
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services