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 -

excel - I can't get the attachement of the email PHP -

node.js - Express and Redis - If session exists for this user, don't allow access -