RE: Newbie: Composition by Association - Pagination Class general question.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux