SHOW:
|
|
- or go back to the newest paste.
1 | - | <?php |
1 | + | $connection = new Connection; |
2 | - | /** |
2 | + | $connection->connect(); |
3 | - | * blogPostHandler.class.php |
3 | + | $connection->runQuery("SELECT * FROM `news_posts` ORDER BY `date` DESC LIMIT $start , $count"); |
4 | - | * |
4 | + | |
5 | - | * PHP versions 4 and 5 |
5 | + | while($row = mysql_fetch_array($connection->getResult())) |
6 | - | * |
6 | + | |
7 | - | * LICENSE: This source file is subject to version 3.0 of the PHP license |
7 | + | $post = new BlogPost; |
8 | - | * that is available through the world-wide-web at the following URI: |
8 | + | $post->setDetailsFromRow($row); |
9 | - | * http://www.php.net/license/3_0.txt. If you did not receive a copy of |
9 | + | echo $post->getGeneratedPostHtml(); |
10 | - | * the PHP License and are unable to obtain it through the web, please |
10 | + | |
11 | - | * send a note to [email protected] so we can mail you a copy |
11 | + | $connection->freeResult(); |
12 | - | * |
12 | + | $connection->close(); |