diff options
author | z0rglub <z0rglub@piwigo.org> | 2003-05-27 20:56:13 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2003-05-27 20:56:13 +0000 |
commit | 0b6204e5fbebb7dc14bfe47e598f53d241c21b97 (patch) | |
tree | 4e457a986c6b177b6c0202b8571f9eda93afa88e /include/functions_category.inc.php | |
parent | 4ac5b8f83f3b27b508be0cdf907eb8b083c251e5 (diff) |
*** empty log message ***
git-svn-id: http://piwigo.org/svn/trunk@19 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_category.inc.php')
-rw-r--r-- | include/functions_category.inc.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php index aa4e277dc..21de2ad71 100644 --- a/include/functions_category.inc.php +++ b/include/functions_category.inc.php @@ -405,6 +405,10 @@ function initialize_category( $calling_page = 'category' ) $words = explode( ',', $_GET['search'] ); $sql_search = array(); foreach ( $words as $i => $word ) { + // if the user searchs any of the words, the where statement must + // be : + // field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' ... + // OR field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' ... if ( $_GET['mode'] == 'OR' ) { if ( $i != 0 ) $page['where'].= ' OR'; @@ -413,6 +417,9 @@ function initialize_category( $calling_page = 'category' ) $page['where'].= ' '.$field." LIKE '%".$word."%'"; } } + // if the user searchs all the words : + // ( field1 LIKE '%$word1%' OR field2 LIKE '%$word1%' ) + // AND ( field1 LIKE '%$word2%' OR field2 LIKE '%$word2%' ) else if ( $_GET['mode'] == 'AND' ) { if ( $i != 0 ) $page['where'].= ' AND'; |