> I don't know much about PDO, but in raw MySQL SQL you'd have something
> similar to this...
> 
> function Select($table, $where, $page = false, $perpage = 20)
> {
>   $sql = 'select * from '.$table.' where '.$where;
>   if ($page !== false)
>   {
>     $sql .= ' limit '.(($page-1)*$perpage).', '.$perpage;
>   }
>   // now run the query and return the results
>   ...
> }

I believe I understand the pagination logic. 
If I'd like to put some general mysql function, I will put them on the abstract 
DAO class. However, I will not use a general CRUD because a DAO pattern works 
pretty well for now, and I still don't understand if there is any advantage by 
using a general CRUD and DAO together. But, apart from that, I do get the 
pagination logic I believe. What I don't get is how that logic could be related 
with the DAOs.

Anyway, I will try to code some lines to see what comes out...


Regards and thanks for your time Stuart,
Márcio




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to