skewbert
skewbert

Reputation: 53

PHP Pagination using count and possibly group by

I am using COUNT and GROUP BY to only show unique results in a database query. EX:

$result = $db->query("SELECT *,COUNT(clientname) 
   FROM recruitingForm 
  GROUP BY clientname LIMIT $offset, $rowsperpage");

There is also the beginnings of pagination going on, but it is giving me the results of the entire database and not my smaller list. How do i set up my db query in order to do that?

Upvotes: 0

Views: 662

Answers (1)

skewbert
skewbert

Reputation: 53

Fixed - By removing COUNT(clientname). LIMIT was never in my pagination code to begin with.

Upvotes: 1

Related Questions