I am trying to convert my old queries to mysqli + prepare statement but I could use some help.
My old loop looks something like this:
$query = "SELECT * FROM `table`;";
$result = @mysql_query($query);
if (@mysql_num_rows($result) > 0) {
for ($i=0; $i < @mysql_num_rows($result); $i++) {
$row = @mysql_fetch_array($result);
print $row['id'];
print " - ";
print $row['username'];
print "<br>";
}
}
But I am stuck with the mysqli + prepare statement..
Thanks!