daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Jul 23rd, 2018 53 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. try {
  2. $db = new PDO("mysql:host=$hostname;dbname=$database;port=$port", $username, $password);
  3. $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  4. $query = "SELECT * FROM registrations WHERE exported = 0";
  5. $stmt = $db->prepare($query);
  6. $stmt->execute();
  7. while($row = $stmt->fetch())
  8. {var_dump($row);}
  9. }
  10. catch(PDOException $e)
  11. {
  12. echo $e->getMessage();
  13. echo $sql;
  14.  
  15. }
  16.  
  17. ** output **
  18.  
  19. object(PDOStatement)#2 (1) {
  20.   ["queryString"]=>
  21.   string(52) "SELECT * FROM `registrations` WHERE `exported` = '0'"
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top