How to get the result of an query

34 views
Skip to first unread message

Michael Gohl

unread,
Jan 26, 2017, 8:14:47 AM1/26/17
to openresty-en
Hey guys 

I am using the mysql-lua extension:

res, err, errcode, sqlstate =
                      db:query("select u, sfrom tableDB WHERE ik= '"..ik.."' and ip = '"..ngx.var.remote_addr.."'", 1)

But how can I get the answer?

res["u"], res.u, res[0]["u"] doesn't work. Can someone give me a hint?

Thanks

Michael Gohl

unread,
Jan 26, 2017, 9:11:26 AM1/26/17
to openresty-en
res[1] is it
Reply all
Reply to author
Forward
0 new messages