prepared statements - creating a single method*
<p>FYI...ended up going with PDO solution as this was simpler.</p>

<p>I'm trying to add a single method to handle all queries to the database. I want the queries to use parameter binding.  How do I handle a variable amount of function parameters in mysqli_stmt_bind_param()?</p>

<p>This post <a href="http://stackoverflow.com/questions/7380657/prepared-statements-are-they-necessary">here</a> led me to understand the pros of parameter binding.</p>

<p>Here is my example code..where I am currently stuck at is marked.</p>

<p>INPUT PARAMETERS</p>

<pre><code>  $query = "INSERT INTO b0 VALUES (?, ?, ?)"
  $par_arr = {'bookmark', 'http://www.bookmark.com', 'tag'}
</code></pre>

<p>PROTOTYPE CODE</p>

<pre><code>  protected static function query($query, $par_arr)
    {
    if($statement=mysqli_prepare(one::$db, $query) 
      {
      mysqli_stmt_bind_param($statement, "s", ...variable amount of parameters...);&lt;----how should this be hanlded?
      ...
</code></pre>
