ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: mewbie on January 11, 2018, 10:22:07 am

Title: How to retrieve query count number from filtering result
Post by: mewbie on January 11, 2018, 10:22:07 am
I need to retrieve the number of records returned with its total page for filtering result based on your example.
I can retrieve it with something like this:

Quote
$query ="SELECT count(*) FROM table where column='query'";

but not with:

Quote
$query ="SELECT count(*) FROM table ".$filterQuery;

When I peeked inside, indeed, $filterQuery is equal to where column= ?

Do you have a workaround?
Thanks

Title: Re: How to retrieve query count number from filtering result
Post by: mewbie on January 11, 2018, 01:15:03 pm
I've got it, I should prepare it first before execute,

Quote
       
$stmt= $dbh->prepare($query);
$stmt->execute($filterParam);

But I still like to know the most effective way mixing filter, paging, sorting in php, I still DRY myself in my code.
Do you have that example?

Thanks