TPiddock

PHP Connection Class usage - Snippet

Apr 11th, 2013
1,070
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $connection = new Connection;
  2. $connection->connect();
  3. $connection->runQuery("SELECT * FROM `news_posts` ORDER BY `date` DESC LIMIT $start , $count");
  4.  
  5. while($row = mysql_fetch_array($connection->getResult()))
  6. {
  7.     $post = new BlogPost;
  8.     $post->setDetailsFromRow($row);
  9.     echo $post->getGeneratedPostHtml();
  10. }
  11. $connection->freeResult();
  12. $connection->close();
Advertisement
Add Comment
Please, Sign In to add comment