THANKS TO ULRIK PETERSON!
}
/// Some differences in syntax for entrygreSQL
- if ($CFG->dbtype == "entrygres7") {
+ switch ($CFG->dbtype) {
+ case 'postgres7':
$LIKE = "ILIKE"; // case-insensitive
$NOTLIKE = "NOT ILIKE"; // case-insensitive
$REGEXP = "~*";
$NOTREGEXP = "!~*";
- } else {
+ break;
+ case 'mysql':
+ default:
$LIKE = "LIKE";
$NOTLIKE = "NOT LIKE";
$REGEXP = "REGEXP";
$NOTREGEXP = "NOT REGEXP";
- }
+ break;
+ }
$conceptsearch = "";
$definitionsearch = "";
}
$count = count_records_sql("select count(*) $sqlfrom $sqlwhere");
$sqllimit = '';
+
if ( $offset >= 0 ) {
- $sqllimit = " LIMIT $offset, $entriesbypage";
+ switch ($CFG->dbtype) {
+ case 'postgres7':
+ $sqllimit = " LIMIT $entriesbypage OFFSET $offset";
+ break;
+ case 'mysql':
+ $sqllimit = " LIMIT $offset, $entriesbypage";
+ break;
+ }
}
+
$allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby $sqllimit");
?>
\ No newline at end of file