- $parts = preg_split('/\sORDER\s*BY\s/si', $sql, 2);
- if(count($parts) == 2) {
- $sql = $parts[0];
- $this->order = $parts[1];
- }
- $parts = preg_split('/\sGROUP\s*BY\s/si', $sql, 2);
- if(count($parts) == 2) {
- $sql = $parts[0];
- $this->group = $parts[1];
- }
- $parts = preg_split('/\sWHERE\s/si', $sql, 2);
- if(count($parts) == 2) {
- $sql = $parts[0];
- $this->where = $parts[1];
+ $parts = preg_split('/\sFROM\s/si', $sql, 2);
+ if (count($parts) == 2) {
+ $this->select = $parts[0];
+ $sql = $parts[1];
+ } else {
+ if ($SysPrefs->go_debug)
+ display_error("Invalid sql input for db_pager");