Permalink
Browse files

Fixes #1, this uses backticks as a seperator for host vs db name fields

  • Loading branch information...
kormoc committed Sep 23, 2012
1 parent 72a67fe commit e29ec6551707c829bf6f805c2fbdea4e5bef9134
Showing with 4 additions and 2 deletions.
  1. +3 −1 explain.php
  2. +1 −1 review.php
View
@@ -39,7 +39,9 @@
$return['Warnings'][] = array('Code' => '0', 'Level' => 'Error', 'Message' => "I can't explain this type of query yet");
}
else {
- list($label, $database) = explode('.', $_REQUEST['explainDb']);
+ list($label, $database) = explode('`.`', $_REQUEST['explainDb']);
+ $label = str_replace('`', '', $label);
+ $database = str_replace('`', '', $database);
$host = $explainhosts[$label];
Database::connect(null, $host['user'], $host['password'], null, null, 'pdo', array('dsn' => $host['dsn']), $label);
Database::find($label)->query('USE '.Database::escapeField($database));
View
@@ -299,7 +299,7 @@ function timeStats($row) {
<?php
foreach ($host['databases'] AS $database) {
?>
- <option value="<?php echo "$label.$database"; ?>"> <?php echo "$label.$database"; ?></option>
+ <option value="<?php echo "`$label`.`$database`"; ?>"> <?php echo "`$label`.`$database`"; ?></option>
<?php
}
?>

0 comments on commit e29ec65

Please sign in to comment.