Skip to content

Commit

Permalink
automatic wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed Dec 2, 2002
1 parent 1204e9d commit 2f50683
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$

2002-12-02 Marc Delisle <lem9@users.sourceforge.net>
* db_search.php3: automatic wildcard

2002-12-01 Alexander M. Turek <rabus@users.sourceforge.net>
* libraries/grab_globals.lib.php3: Back to previous version.

Expand Down
6 changes: 5 additions & 1 deletion db_search.php3
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ if (isset($submit_search)) {
$search_wds_cnt = count($search_words);

$like_or_regex = (($search_option == 4) ? 'REGEXP' : 'LIKE');
$automatic_wildcard = (($search_option <3) ? '%' : '');

for ($i = 0; $i < $search_wds_cnt; $i++) {
// Elimines empty values
if (!empty($search_words[$i])) {
for ($j = 0; $j < $tblfields_cnt; $j++) {
$thefieldlikevalue[] = $tblfields[$j]
. ' ' . $like_or_regex
. ' \'' . $search_words[$i] . '\'';
. ' \''
. $automatic_wildcard
. $search_words[$i]
. $automatic_wildcard . '\'';
} // end for

$fieldslikevalues[] = ($search_wds_cnt > 1)
Expand Down

0 comments on commit 2f50683

Please sign in to comment.