summaryrefslogtreecommitdiff
path: root/it_db_table.class
diff options
context:
space:
mode:
Diffstat (limited to 'it_db_table.class')
-rw-r--r--it_db_table.class4
1 files changed, 3 insertions, 1 deletions
diff --git a/it_db_table.class b/it_db_table.class
index 5536ccf..455cf2e 100644
--- a/it_db_table.class
+++ b/it_db_table.class
@@ -55,10 +55,12 @@ function safe_sql_select($query, $fields="*")
/**
* Create an SQL query (the stuff after 'WHERE').
* @see it_dbi::_where() for more details.
+ * @param $sql Optional SQL addendum (added after $params), for ORDER BY etc.
+ * @param $omit_where (optional) Do not add 'WHERE ' at beginning of result (default: false)
*/
function construct_sql_clause($params='', $sql='', $omit_where=false)
{
- return it_dbi::_where($params, $sql, $omit_where);
+ return trim(it_dbi::_where($params, null, $omit_where) . " $sql");
}