Thread: PDO addon
View Single Post
  #1  
Old 5th November 2018, 20:54
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
Default PDO addon
PHP Code:
//PDO$hostname='localhost';$username='root';$password='';try {$pdo = new PDO("mysql:host=$hostname;dbname=torrentbeta",$username,$password);$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line//echo 'Connected to Database';$cache = $pdo->query("SELECT * FROM users");foreach ( $cache as $row) { echo $row["email"] ." - ". $row["ip"] ."<br/>"; }  echo "Access Connected"; $pdo = null;} catch(PDOException $e) {   echo $e->getMessage();} 

PDO connection works remove the query once you see it working an update to PDO standards good luck
Reply With Quote