I've been using prepared statements for a little while now and I've never had any problems.
Now I'm trying to:
$sql="SELECT PhotoID,Caption FROM Photos WHERE EntityID=? AND TypeID=? LIMIT ?,?";
$iDB = new mysqliDB(); // Extends mysqli
$stmt = $iDB->prepare($sql);
$stmt->bind_param('iiii',$entityID,$typeID,$minRange,$maxRange);
$stmt->execute();
$stmt->bind_result($photoID,$caption);
echo("Affected={$stmt->affected_rows}");
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.
Any idea what may be causing this?
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..