Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: PHP  |  size: 0.29 KB  |  hits: 16  |  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. <?php
  2. $db = new PDO('host=localhost;dbname=dbname', $user, $pass);
  3.  
  4. $query = $db->prepare('SELECT * FROM fb_reader WHERE id = :id ORDER BY id ASC');
  5. $query->bindParam(':id', $_GET['id'], PDO::PARAM_INT);
  6. $query->execute();
  7.  
  8. while ($row = $query->fetch(PDO::FETCH_OBJ)) {
  9.     print_r($row);
  10. }