SQL_CALC_FOUND_ROWS and SELECT_FOUND_ROWS() have a different intent -- they determine total rows matching the criteria, but WITHOUT the LIMIT clause. EG. Displaying 25 (LIMIT) out of 233 (FOUND ROWS).

It's also meant to avoid re-running the query.

On Feb 3, 2006, at 8:29 AM, Robert Shubert wrote:

Witango fetches the TOTALROWS using a second SQL statement in the background in a similar matter as you show there, only it simply replaces the select
criteria with count(*).

Therefore if you build this statement:

 SELECT userid, fname, lname FROM users WHERE userid > 0

Which would return some number of rows,

Then executing:

 SELECT count(*) FROM users WHERE userid > 0

Would return the count of those rows.

Hope that helps.

Robert

-----Original Message-----
From: Francis Lebourq [mailto:[EMAIL PROTECTED]
Sent: Friday, February 03, 2006 10:28 AM
To: [email protected]
Subject: Witango-Talk: SELECT FOUND_ROWS(); on MyODBC + WiTango5.5 + OSX

Hi

I use on Mac OS X (Panther) + MySQL 4.1 + MyODBC + WiTango Server 5.0
on production server.
I have a host for WiTango server and a host for MySQL server.


  When i use a Direct DBMS action, to get the "total rows" i use this
method (this is a "work around" because in the Direct DBMS Action the
<@TOTALROWS> tag value is always "-1" :
- First Direct DBMS action :
        SELECT SQL_CALC_FOUND_ROWS ...
- Second Direct DBMS action :
        SELECT FOUND_ROWS();
and this action return the "total rows" value.
It work's fine with WiTango 5.0 server version

BUT with WiTango 5.5.009 server version, the fist action return the
records but the second action return 0 (and the <@TOTALROWS> tags
return always -1).

And i send the request to the same MySQL server
- with the same version of MyODBC (MySQL ODBC Driver 3.51)
- the same version of Panther (10.3.9) and ODBC tools (v 1.0.1) on
the WiTango 5.5 and WiTango 5.0 hosts.

The unique difference is the version of WiTango server...

I have made a test with command line tool "odbctest" on the WiTango
5.5 host :
- First command
        SELECT SQL_CALC_FOUND_ROWS ... --> i get the list of records
- Second command
        SELECT FOUND_ROWS(); --> I get the (good) count of total records.

Therefore, it is not ODBC...

Does somebody have the same configuration and the same problem ?

How to get the "total rows" value with this configuration with
WiTango 5.5 version. ?

Thank you very much

Regards

Francis LEBOURQ

______________________________________________________________________ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

______________________________________________________________________ __
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Bill

William M. Conlon, P.E., Ph.D.
To the Point
345 California Avenue Suite 2
Palo Alto, CA 94306
   vox:  650.327.2175 (direct)
   fax:  650.329.8335
mobile:  650.906.9929
e-mail:  mailto:[EMAIL PROTECTED]
   web:  http://www.tothept.com

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to