Hi Matthew thanks for the additional details.. I added the connection
string and put the two queries together as follows:

<cfquery name="qryCustomers" datasource="#Application.dsn#">

        SELECT SQL_CALC_FOUND_ROWS *
        FROM tbl_customers
        LIMIT 1, 50;

        SELECT FOUND_ROWS() AS totalRows;

</cfquery>

<cfoutput>#qryCustomers.totalRows#</cfoutput>

This code results in the following error: qryCustomers.totalRows
doesn't exist.

Which makes me think... how would I even access the FOUND_ROWS from
the second query? i.e. when there are 2 queries within the same
cfquery block, how would I distiguish one query from the other?


On Dec 1, 5:58 pm, Matthew Woodward <[email protected]> wrote:
> On Thu, Dec 1, 2011 at 2:38 PM, Matthew Woodward <[email protected]>wrote:
>
> > So I believe what you need to do is enable multiple statements
> > (?allowMultiQueries=true) and put both those statements in the same query
> > block separated by a ; because otherwise they aren't part of the same
> > connection to the database, and hence the second statement would fail.
>
> Realize I should have provided more details here.
>
> Go into your MySQL datasource in the OpenBD admin (or you can do this in
> the bluedragon.xml file of course), click on "advanced settings" and in the
> "connection string" box add this:
> allowMultiQueries=true
>
> (Note: do NOT put a ? before that)
>
> Restart OpenBD. Then to test, just write a simple query against any
> table(s) that has two statements in it:
>
> <cfquery name="foo" datasource="foo">
> select foo from bar;
> select bar from baz;
> </cfquery>
>
> If that DOESN'T error out, then multiple statements are enabled.
>
> At that point, try re-running your FOUND_ROWS stuff but all in one query
> block with a ; between statements and see if that makes a difference.
>
> --
> Matthew Woodward
> [email protected]http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.http://www.gnu.org/philosophy/no-word-attachments.html

-- 
online documentation: http://openbd.org/manual/
   google+ hints/tips: https://plus.google.com/115990347459711259462
     http://groups.google.com/group/openbd?hl=en

Reply via email to