This topic is locked

Limiting number of returned records with mysql limit

1/18/2007 1:21:15 PM
PHPRunner General questions
M
markdorminy author

Is there a way to use the mysql limit expression to limit the number of records returned from a query? I can't seem to get it to work. Strangely enough, the error message gives me perfectly good sql - it pastes right in and runs in phpmyadminl, but PHPRunner doesn't seem to like it.
Thanks!

Sergey Kornilov admin 1/18/2007

Starting with version 3.1 PHPRunner adds LIMIT clause itself to retrieve as many records as required which means you don't have to add your own LIMIT clause.
To see exact query that PHPRunner builds set $dDebug variable to true in include/dbcommon.php file and run application.

$dDebug=true;

M
markdorminy author 1/18/2007

Thanks, Sergey! I am using 3.0 for this application. Should I just modify the SQL statement by hand?

Sergey Kornilov admin 1/18/2007

It's quite possible version 3.0 cannot deal with LIMIT clause.
What is the SQL statement that program prints with debug option turned on?

M
markdorminy author 1/19/2007

It's quite possible version 3.0 cannot deal with LIMIT clause.

What is the SQL statement that program prints with debug option turned on?


select `Status_Time`, `Status_Code`, `Comments`, `Commenter`, `LogIndex`, `LogStatusIndex` From `ItemStatus` where `ItemStatus`.`LogIndex`=382 ORDER BY `Status_Time` DESC limit 1