Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. $pdo = new PDO('mysql:host=localhost;dbname=database', 'username', 'password');
  2. $ps = $pdo->prepare("SELECT * FROM wp_users WHERE user_login = ?");
  3. $ps->execute(array($_GET["user_login"]));
  4. $result = $ps->fetch(PDO::FETCH_ASSOC);
  5. /*extract($result);*/
  6.  
  7. var_dump($result);
  8.  
  9. include ("theme/header-main.html");
  10.  
  11. $pdo = new PDO('mysql:host=localhost;dbname=database', 'username', 'password');
  12. $ps = $pdo->prepare("SELECT * FROM wp_users WHERE user_login = ?");
  13. if (!empty($_GET["user_login"])) {
  14. $ps->execute(array($_GET["user_login"]));
  15. } else {
  16. header('location: index.php');
  17. }
  18.  
  19. $result = $ps->fetch(PDO::FETCH_ASSOC);
  20.  
  21. if (is_array($result)) {
  22. extract($result);
  23.  
  24. include('TESTuser-content.php');
  25.  
  26. } else {
  27. include('user-content-search.php');
  28. }
  29.  
  30. include ("theme/footer-main.html");
  31.  
  32. $pdo = new PDO('mysql:host=localhost;dbname=database', 'username', 'password');
  33. $ps = $pdo->prepare("SELECT user_login FROM wp_users WHERE user_login = ?");
  34. $result = $ps->fetchall();
  35.  
  36. <?php foreach($result as $row){echo $row[0]} ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement