title: PHP MySQLi issue with prepared SELECT variable not binding
body: <p>Having another PHP issue that's probably something simple, but I'd really appreciate any help!</p>
  
  <p>My function does a mysqli count but the $count parameter it gets bound to is not changed, even though the sql runs fine and there are no errors.</p>
  
  <p>The function:</p>
  
  <pre><code>function itemsCount ($conn, $list_id) {
      $count = 0;
      if (!($stmt = $conn-&gt;prepare("SELECT count(uid) FROM collection.user_list_item WHERE list_id = ?"))) {
        echo "Prepare failed: " . $mysqli-&gt;error;
     }
     if (!($stmt-&gt;bind_param('i', $list_id))) {
        echo "Bind failed: " . $stmt-&gt;error;
     }
     if (!($stmt-&gt;execute())) {
        echo "Execute failed: " . $stmt-&gt;error;
     }
     if (!($stmt-&gt;bind_result($count))) {
        echo "Bind failed: " . $stmt-&gt;error;
     }
     echo $count;
     $stmt-&gt;close();
     return $count;
  }
  </code></pre>
  
  <p>And the call:</p>
  
  <pre><code>public function doAdd ($conn, $list_id, $item_id) {
     if ($this-&gt;itemsCount($conn, $list_id) &lt; 20) {
        ...do stuff ...
     }
  }
  </code></pre>
  
  <p>Sorry the code isn't very nice, but please help point me in the right direction!</p>