title: Get total number of rows when using LIMIT and UNION in mysql query
body: <p><code>Query:</code>  </p>
  
  <pre><code>SELECT
      tbl_a.id as aid,
      tbl_a.name as aname,
      null location,
      .....
      .....
      from tbl_a
      .........//left join to fetch some other data
      .........//where condition
  UNION ALL
      0 aid,
      null aname,
      tbl_b.location as location,
      .....
      .....
      from tbl_b
      .........//left join to fetch some other data
      .........//where condition
  limit '.$recordperpage.' OFFSET '.$offset.'
  </code></pre>
  
  <p>here,<code>$recordperpage</code> and <code>$offset</code> is dynamic.</p>
  
  <p>now i am trying to fetch all no. of rows without limit.</p>
  
  <blockquote>
    <p>exa:<br>
    No. of rows with limit: 20<br>
    No. of rows without limit: 50<br>
    i am trying to fetch no. of rows without limit(means 50).  </p>
  </blockquote>
  
  <p>So how to achive that?
  Thanks in advance.</p>