title: PHP Prepared Statement Returns -1
body: <p>I've been using prepared statements for a little while now and I've never had any problems.</p>
  
  <p>Now I'm trying to:</p>
  
  <pre><code>$sql="SELECT PhotoID,Caption FROM Photos WHERE EntityID=? AND TypeID=? LIMIT ?,?";
  
  $iDB = new mysqliDB(); // Extends mysqli
  
  $stmt = $iDB-&gt;prepare($sql);
  
  $stmt-&gt;bind_param('iiii',$entityID,$typeID,$minRange,$maxRange);
  
  $stmt-&gt;execute();
  
  $stmt-&gt;bind_result($photoID,$caption);
  
  echo("Affected={$stmt-&gt;affected_rows}");
  </code></pre>
  
  <p>This prints -1.  I have triple tested that all 4 values in bindParam are set, and that the sql query works when pasted into myAdmin with the respective values.</p>
  
  <p>Any idea what may be causing this?</p>
  
  <p>Edit:: I found the answer online, apparently I need to use $stmt->store_result(); after executing.. but I am not sure it's needed now and never before..</p>