Commit b0977bcab5b0e7b33ee53de12eed3b36d4ea61d4
1 parent
6269674d
paramArray is useful when we have a variable-list sized IN (...) SQL
statement. escapeSimple allows legacy code to use the loaded database's escapeSimple until we can clean it up properly. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3051 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
10 additions
and
0 deletions
lib/database/dbutil.inc
| @@ -196,6 +196,16 @@ class DBUtil { | @@ -196,6 +196,16 @@ class DBUtil { | ||
| 196 | return DBUtil::runQuery(array($sQuery, $aParams), $db); | 196 | return DBUtil::runQuery(array($sQuery, $aParams), $db); |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | + function ¶mArray($aArray) { | ||
| 200 | + $iNumIds = count($aArray); | ||
| 201 | + return join(",", array_fill(0, $iNumIds, '?')); | ||
| 202 | + } | ||
| 203 | + | ||
| 204 | + function &escapeSimple($sString, $db = null) { | ||
| 205 | + $db =& DBUtil::getDB(); | ||
| 206 | + return $db->escapeSimple($sString); | ||
| 207 | + } | ||
| 208 | + | ||
| 199 | } | 209 | } |
| 200 | 210 | ||
| 201 | ?> | 211 | ?> |