lua-resty-mysql
lua-resty-mysql copied to clipboard
can not use "not res" to judge if the 'res' is empty table
the Synopsis in readme use
local res, err, errcode, sqlstate = db:query("drop table if exists cats") if not res then ngx.say("bad result: ", err, ": ", errcode, ": ", sqlstate, ".") return end
"not res" cannot judge
you shoud use next(use) or calculate the length to judge