Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 30th, 2013  |  syntax: PHP  |  size: 0.25 KB  |  views: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         public function getPostData($iPostId) {
  2.                 $sqlQuery = $this->db->query("SELECT * FROM posts WHERE id = " . $iPostId . ";");
  3.                 $aResult = $sqlQuery->result_array();
  4.                 if (empty($aResult)) {
  5.                         show_404();
  6.                 }
  7.                 else {
  8.                         return $aResult[0];
  9.                 }
  10.         }