include a formatting error if they pass an array where we're not expecting one

This commit is contained in:
Sergey Tsalkov
2013-02-22 11:52:18 -08:00
parent 7df5c9baa2
commit 7364df36cf

View File

@@ -541,8 +541,10 @@ class MeekroDB {
if (is_array($result)) {
if (! $array_type) $result = $result[0];
else $result = '(' . implode(',', $result) . ')';
if (is_array($result)) $this->nonSQLError("Badly formatted SQL query: $sql -- you passed an array but I didn't expect one!");
}
$sql = substr_replace($sql, $result, $new_pos, $length_type + $arg_number_length);
$pos_adj += strlen($result) - ($length_type + $arg_number_length);
}