data, forum, glossary: use sql_ilike() for a portable LIKE operator

This commit is contained in:
martinlanghoff
2006-09-26 05:08:18 +00:00
parent 95008f81c6
commit a8f4522dfa
3 changed files with 13 additions and 19 deletions
+2 -9
View File
@@ -147,24 +147,17 @@
$where = '';
$fullpivot = 0;
if ($CFG->dbtype == "postgres7") {
$LIKE = "ILIKE"; // case-insensitive
} else {
$LIKE = "LIKE";
}
$LIKE = sql_ilike();
$NOTLIKE = 'NOT ' . $LIKE;
switch ( $mode ) {
case 'search':
/// Some differences in syntax for PostgreSQL
if ($CFG->dbtype == "postgres7") {
$LIKE = "ILIKE"; // case-insensitive
$NOTLIKE = "NOT ILIKE"; // case-insensitive
$REGEXP = "~*";
$NOTREGEXP = "!~*";
} else {
$LIKE = "LIKE";
$NOTLIKE = "NOT LIKE";
$REGEXP = "REGEXP";
$NOTREGEXP = "NOT REGEXP";
}