Delphi Datasnap Server MySQL FOUND_ROWS() return 1 -


i have delphi xe8 datasnap server getproduct method returning 2 tfdquery in tfdjsondatasets

function tservermethods1.getproduct: tfdjsondatasets; begin   // clear active query reexecute.   fdqueryresult.active    := false;   fdqueryfoundrows.active := false;    result := tfdjsondatasets.create;    tfdjsondatasetswriter.listadd(result, 'result',    fdqueryresult);    tfdjsondatasetswriter.listadd(result, 'foundrows', fdqueryfoundrows); end; 

fdqueryresult.sql.text is:

select sql_calc_found_rows * products limit 0,100 

fdqueryfoundrows.sql.text is:

select found_rows() foundrows 

the problem

fdqueryfoundrows return 1, same query on mysql workbrench return correct number.

i think fdqueryresult after execution close connection , fdqueryfoundrows reopen it, found_rows() work on same connection.

how can fix it?


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -