summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authorJamie Matthews <[email protected]>2010-10-22 02:04:42 +0100
committerJamie Matthews <[email protected]>2010-10-22 02:04:42 +0100
commitf93ad0a9d59e076f654da32c628743ba67284e03 (patch)
tree7b6b6639b0f2ca3b0983a2fb872168e349b66a32 /idiorm.php
parent37cb37a1c310a60dc8ba4329e03d6ae7d8bf6fb0 (diff)
Fix query binding in _log_query method
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/idiorm.php b/idiorm.php
index 7e7a70b..58a67ae 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -218,11 +218,11 @@
// Escape the parameters
$parameters = array_map(array(self::$_db, 'quote'), $parameters);
- // Build an array containing the same number of ? placeholders as there are params
- $placeholders = array_fill(0, count($parameters), '?');
+ // Replace placeholders in the query for vsprintf
+ $query = str_replace("?", "%s", $query);
// Replace the question marks in the query with the parameters
- $bound_query = str_replace($placeholders, $parameters, $query);
+ $bound_query = vsprintf($query, $parameters);
} else {
$bound_query = $query;
}