brasofilo

SOPT 30986

Aug 31st, 2014
324
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $rs = $pdo->query("SELECT * FROM posts ORDER BY ID DESC ")->fetchAll();
  3. if($rs) {
  4.     $count = count($rs);
  5.     if($count == 0) {
  6.         echo "Nada foi encontrado";
  7.     } else {
  8.         foreach($rs as $res) {  
  9.             printf(
  10.                 '%s disse :: %s',
  11.                 $res['ID_USER'],
  12.                 $res['TEXTO']
  13.             );
  14.     }
  15. } else {
  16.     print_r($pdo->errorInfo());
  17. }
RAW Paste Data