diff --git a/includes/database.inc b/includes/database.inc
index 683ae69..cd6c502 100644
--- a/includes/database.inc
+++ b/includes/database.inc
@@ -248,8 +248,15 @@ function _db_query_callback($match, $init = FALSE) {
  *   The Schema API type of a field (e.g. 'int', 'text', or 'varchar').
  */
 function db_placeholders($arguments, $type = 'int') {
-  $placeholder = db_type_placeholder($type);
-  return implode(',', array_fill(0, count($arguments), $placeholder));
+  // After ensuring that there is at least one element in the arguments array,
+  // use str_repeat for all elements beyond the first.
+  if (empty($arguments)) {
+    return '';
+  }
+  else {
+    $placeholder = db_type_placeholder($type);
+    return $placeholder . str_repeat(',' . $placeholder, count($arguments) - 1);
+  }
 }
 
 /**
