Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_startup_errors',1);
- ini_set('display_errors',1);
- error_reporting(-1);
- class App
- {
- const DB_HOST = '127.0.0.1';
- const DB_USERNAME = 'root';
- const DB_PASSWORD = 'root';
- public function run() {
- echo 'Prefix: ' . $this->_getPrefix('ftf');
- }
- protected function _getPrefix($dbname) {
- $db = new PDO("mysql:host=".SELF::DB_HOST.";dbname=$dbname",SELF::DB_USERNAME,SELF::DB_PASSWORD);
- $sql = 'SHOW tables like :config';
- $q = $db->prepare($sql);
- $q->bindValue(':config', '%core_config_data%');
- $q->execute();
- $data = $q->fetchAll();
- $data = explode("core_config_data", $data[0][0]);
- return $data[0];
- }
- }
- $app = new App();
- $app->run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement