samroar04

Untitled

Jan 29th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. <?php
  2. $dbh = new PDO('mysql:host=localhost;dbname=reddit','root',"");
  3. function reddit($select) {
  4. $dbh->query($result="SELECT id,title,user,subreddit,url from posts");
  5. foreach ($select->query($result) as $row) {
  6. print $row['id']. "\t";
  7. print $row['title']. "\t";
  8. }
  9. }
  10. ?>
Advertisement
Add Comment
Please, Sign In to add comment