From 983823c499ab3aea81298a8284dbb8d28b4a1b1b Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 8 Aug 2007 12:33:16 +0000 Subject: Make _where use proper db link and moved db_table only code to db_table.class --- it_db_table.class | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'it_db_table.class') 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"); } -- cgit v1.2.3