- $result_tasks = SQL_QUERY("SELECT id, assigned_admin, userid, task_type, subject, text, task_created
-FROM "._MYSQL_PREFIX."_task_system
-WHERE ".$whereStatement."
-ORDER BY userid DESC, task_type DESC, subject, task_created DESC", __FILE__, __LINE__);
- if (($SEL > 0) && (!IS_DEMO())) {
+ $result_tasks = SQL_QUERY('SELECT
+ `id`, `assigned_admin`, `userid`, `task_type`, `subject`, `text`, `task_created`
+FROM
+ `{?_MYSQL_PREFIX?}_task_system`
+WHERE
+ '.$whereStatement.'
+ORDER BY
+ `userid` DESC,
+ `task_type` DESC,
+ `subject` ASC,
+ `task_created` DESC',
+ __FILE__, __LINE__);
+ if (($SEL > 0) && (!isDemoModeActive())) {