Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Oct 23rd, 2015 63 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2. ini_set('display_startup_errors',1);
  3. ini_set('display_errors',1);
  4. error_reporting(-1);
  5.  
  6. class App
  7. {
  8.     const DB_HOST = '127.0.0.1';
  9.     const DB_USERNAME = 'root';
  10.     const DB_PASSWORD = 'root';
  11.  
  12.     public function run() {
  13.         echo 'Prefix: ' . $this->_getPrefix('ftf');
  14.     }
  15.    
  16.     protected function _getPrefix($dbname) {
  17.         $db = new PDO("mysql:host=".SELF::DB_HOST.";dbname=$dbname",SELF::DB_USERNAME,SELF::DB_PASSWORD);
  18.         $sql = 'SHOW tables like :config';
  19.         $q = $db->prepare($sql);
  20.         $q->bindValue(':config', '%core_config_data%');
  21.         $q->execute();
  22.         $data = $q->fetchAll();
  23.         $data = explode("core_config_data", $data[0][0]);
  24.    
  25.         return $data[0];
  26.     }
  27. }
  28.  
  29. $app = new App();
  30. $app->run();
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