Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('../functions.php');
- function retrieveRegionDatabases() {
- $db = connect_to_local_snipe_db();
- $show_dbs_results = $db->query('SHOW DATABASES');
- $results = $show_dbs_results->fetchAll(PDO::FETCH_ASSOC);
- return $results;
- }
- $region_databases = retrieveRegionDatabases();
- print "\nRegion Databases:\n";
- print_r($region_databases);
- die("EXITING...\n\n");
- // Usage without mysql_list_dbs()
- $link = mysql_connect('localhost', 'root', '0r?;*\E{0reM');
- $res = mysql_query("SHOW DATABASES");
- $schemas = [];
- while ($row = mysql_fetch_assoc($res)) {
- array_push($schemas, $row['Database']);
- }
- foreach ($schemas as $schema) {
- // $host="127.0.0.1";}
- // $port=3306;
- // $user="root";
- // $password="'0r?;*\\E{0reM";
- $dbname = $schema;
- $socket = '';
- $con = new mysqli('localhost', 'root', '0r?;*\E{0reM', $dbname, 3306, $socket)
- or die ('Could not connect to the database server' . mysqli_connect_error()); //$con->close();
- $query = "SELECT field_encrypted FROM `$dbname`.`custom_fields";
- if ($stmt = $con->prepare($query)) {
- $stmt->execute();
- $stmt->bind_result($field_encrypted);
- while ($stmt->fetch()) {
- echo $dbname . ": ";
- printf("%s\n", $field_encrypted);
- }
- $stmt->close();
- }
- }
Add Comment
Please, Sign In to add comment