Browse files

Search in all tables

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1302 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent c3137f8 commit 3313f7baa1934f279245ccb81eceaad29d5d6d73 jakubvrana committed Feb 3, 2010
Showing with 28 additions and 0 deletions.
  1. +2 −0 changes.txt
  2. +25 −0 editor/db.inc.php
  3. +1 −0 todo.txt
View
2 changes.txt
@@ -1,8 +1,10 @@
Adminer 2.3.0-dev:
Support for permanent login (customization required)
+Search in all tables (Editor)
Show status variables
Print sums in tables overview
Add Delete button to Edit page (regression from 2.0.0)
+Print error summary in SQL command
Simplify SQL syntax error message
Show SQL query info if available
Delete length when changing type in alter table
View
25 editor/db.inc.php
@@ -1,2 +1,27 @@
<?php
page_header(lang('Server'), "", null);
+
+?>
+<form action=""><p>
+<?php if (SID) { ?><input type="hidden" name="<?php echo session_name(); ?>" value="<?php echo h(session_id()); ?>"><?php } ?>
+<input name="where[][val]" value="<?php echo h($_GET["where"][0]["val"]); ?>">
+<input type="submit" value="<?php echo lang('Search'); ?>" />
+</form>
+<?php
+if ($_GET["where"]) {
+ $found = false;
+ foreach (table_status() as $table => $table_status) {
+ $name = $adminer->tableName($table_status);
+ if (isset($table_status["Engine"]) && $name != "") {
+ $result = $connection->query("SELECT 1 FROM " . idf_escape($table) . " WHERE " . implode(" AND ", $adminer->selectSearchProcess(fields($table), array())) . " LIMIT 1");
+ if ($result->num_rows) {
+ if (!$found) {
+ echo "<ul>\n";
+ $found = true;
+ }
+ echo "<li><a href='" . h(ME . "select=" . urlencode($table) . "&where[][val]=" . urlencode($_GET["where"][0]["val"])) . "'>" . h($name) . "</a>\n";
+ }
+ }
+ }
+ echo ($found ? "</ul>" : "<p class='message'>" . lang('No tables.')) . "\n";
+}
View
1 todo.txt
@@ -9,6 +9,7 @@ Variables editation, especially timezone
Use event $intervals + microseconds in relative date functions
Optionally check IP address
Disable spell checking in SQL textareas - spellcheck="false"
+Blob download and image display in edit form (important for Editor with hidden fields in select)
? Column and table names auto-completition in SQL textarea
? Aliasing of built-in functions can save 7 KB, function minification can save 7 KB, substitution of repetitive $a["a"] can save 4 KB, substitution of $_GET and friends can save 2 KB, JS packer can save 1 KB, not enclosing HTML attribute values can save 1.2 KB, replacing \\n by \n can save .3 KB
? Branch binary_compile: LZW compression of translations can save 30 KB, LZW compression of all texts can save 11 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB

0 comments on commit 3313f7b

Please sign in to comment.