From 0b6204e5fbebb7dc14bfe47e598f53d241c21b97 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Tue, 27 May 2003 20:56:13 +0000 Subject: *** empty log message *** git-svn-id: http://piwigo.org/svn/trunk@19 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_category.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/functions_category.inc.php') 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'; -- cgit v1.2.3