Hello!
On Mon, Nov 25, 2013 at 8:13 AM, Đang Trường Nguyễn wrote:
> I trying execute a sql query "select count(*) from test" by drizzle_query.
> my code :
> location / {
> set $q 'select count(*) from test';
> drizzle_query $q;
> drizzle_pass backend;
> }
> Can i get result it as $tmp count(*); if($tmp > 0)??How can get it??
You can just use ngx_lua's ngx.location.capure() API function to
capture the subrequest's response. See
https://github.com/chaoslawful/lua-nginx-module#ngxlocationcapture
and also
https://github.com/agentzh/lua-rds-parser#readme
Because you'll be using Lua, you're recommended to switch over to
lua-resty-mysql instead, which is more flexible:
https://github.com/agentzh/lua-resty-mysql
BTW, you're recommended to join the openresty-en mailing list for such
questions: https://groups.google.com/group/openresty-en I'm cc'ing
this list :)
Best regards,
-agentzh