tags:

views:

43

answers:

1

How can I connect to a MySQL database from using Lua programming language?

If a good/popular library exists, what is it?

+1  A: 

From LuaSQL -- Database connectivity for the Lua programming language:

require "luasql.mysql"
env = assert (luasql.mysql())
con = assert (env:connect"my_db")
for id, name, address in rows (con, "select * from contacts") do
  print (string.format ("%s: %s", name, address))
end
Judge Maygarden