Bravo List
Register
Go Back   > Bravo List > Source Code > Trackers > Torrent Trader > Mods & Themes
Reply
  #1  
Old 05-11-18, 20:54
BamBam0077's Avatar
BamBam0077 BamBam0077 is offline
Support
 
Join Date: Jul 2013
P2P
Posts: 293
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
  #2  
Old 05-11-18, 22:06
Napon's Avatar
Napon Napon is offline
Senior Member
 
Join Date: Feb 2016
P2P
Posts: 376
Default
lol
Reply With Quote
  #3  
Old 19-11-18, 09:59
BamBam0077's Avatar
BamBam0077 BamBam0077 is offline
Support
 
Join Date: Jul 2013
P2P
Posts: 293
Default
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';
echo "Access Connected";
$pdo = null;
} catch(PDOException $e) {  
 echo $e->getMessage();
}
Reply With Quote
  #4  
Old 19-11-18, 11:47
DND's Avatar
DND DND is offline
Support
 
Join Date: Dec 2008
Posts: 1,065
Default
addon ?
__________________
Need HELP!? I can install:

  1. Server/VPS (Debian,CentOS,Ubuntu,Fedora, FreeBSD) Optimization and ... + Modules
  2. Webserver Windows/Linux (Apache/Lighttpd/Nginx/Mysql/PhpMyAdmin/SSL) Optimization and ... + Modules
  3. Seedbox Windows/Linux (uTorrent,rTorrent,libTorrent,ruTorrent) + Modules
  4. TBDev Support
  5. Gazelle Support Install
  6. TSSE Install Support
Reply With Quote
  #5  
Old 23-11-18, 03:37
BamBam0077's Avatar
BamBam0077 BamBam0077 is offline
Support
 
Join Date: Jul 2013
P2P
Posts: 293
Default
Code:
  function setupDatabase()
    {
        // put your database information mentioned above here
        $username = 'root';
        $password = 'root';
        $host = 'localhost';
        $dbname = 'verify';

        try {
            $pdo = new PDO("mysql:host=$host;dbname=$dbname",$username,$password);
            $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

        } catch(PDOException $e) {
            return 'ERROR: ' . $e->getMessage();
        }

        return $pdo;
    }
Reply With Quote
Reply

Tags
addon , pdo

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 06:31. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2019, vBulletin Solutions Inc.