From 46a0e882bec7de66c5513af54c969f9ea3a40c36 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 5 May 2004 17:24:52 +0000 Subject: [PATCH] Patch 939197 --- ChangeLog | 4 ++++ tbl_select.php | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6ea94eb66..10310e269 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2004-05-05 Marc Delisle + * tbl_select.php: patch #939197, new choice of operator LIKE %...% + because this syntax is so often used, thanks to Ruben Barkow (rubo77) + 2004-05-05 Garvin Hicking * db_details_db_info.php, db_details_structure.php, left.php: Speed up table fetching when using $cfg['ShowTooltips']. Allow to only diff --git a/tbl_select.php b/tbl_select.php index 31f586323..8d15a9d28 100644 --- a/tbl_select.php +++ b/tbl_select.php @@ -37,7 +37,7 @@ if ($cfg['PropertiesIconic'] == true) { * LIKE works also on integers and dates so I added it in numfunctions */ $numfunctions = array('=', '>', '>=', '<', '<=', '!=', 'LIKE', 'NOT LIKE'); -$textfunctions = array('LIKE', 'NOT LIKE', '=', '!=', 'REGEXP', 'NOT REGEXP'); +$textfunctions = array('LIKE %...%','LIKE', 'NOT LIKE', '=', '!=', 'REGEXP', 'NOT REGEXP'); $enumfunctions = array('=', '!='); $nullfunctions = array('IS NULL', 'IS NOT NULL'); $unaryfunctions = array( @@ -341,6 +341,12 @@ else { } else { $quot = ''; } + + // LIKE %...% + if ($func_type == 'LIKE %...%') { + $func_type = 'LIKE'; + $fields[$i] = '%' . $fields[$i] . '%'; + } $w[] = PMA_backquote(urldecode($names[$i])) . ' ' . $func_type . ' ' . $quot . PMA_sqlAddslashes($fields[$i]) . $quot; } // end if