Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader > Mods & Themes
Reply
  #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
  #2  
Old 5th November 2018, 22:06
Napon Napon is offline
Banned
 
Join Date: Feb 2016
P2P
Posts: 522
Default
lol
Reply With Quote
  #3  
Old 19th November 2018, 09:59
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
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 19th November 2018, 11:47
DND DND is offline
VIP
 
Join Date: Dec 2008
Posts: 1,241
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. Multiple source code engines
  5. Linux Server Administration (security, cryptography/encryption, proxy, load balancer, custom ddos firewall)
Reply With Quote
  #5  
Old 23rd November 2018, 03:37
BamBam0077 BamBam0077 is offline
Banned
 
Join Date: Jul 2013
P2P
Posts: 410
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 17:48. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.