Menu
Im just wondering which format you guys prefer:
[code=php]
// Option 1:
$result = $db->query($query);
$num_rows = $result->num_rows;
for( $i=1; $i<=$num_rows; $i++ ) {
$row = $result->fetch_assoc();
// Do stuff with $row
}
Or
[code=php]
// Option 2:
$result = $db->query($query);
$num_rows = $result->num_rows;
$i = 1;
while( $i<=$num_rows ) {
$row = $result->fetch_assoc();
$i++;
// Do stuff with $row
}