blob: 085ce978c7aaa2c9ceef7fb49602054a41ee6d02 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
local s = require"luasql.postgres"
local env = assert (luasql.postgres ())
local conn = assert (env:connect ("luasql-test", "tomas"))
local cur = assert (conn:execute ("select count(*) from fetch_test"))
cgilua.htmlheader()
cgilua.put ("Total lines at table fetch_test is "..cur:fetch())
cgilua.put (string.format ("<br>\n%s == %s<br>\n", tostring(s), tostring(luasql)))
cur:close()
conn:close()
env:close()
|