I have a bit of dilemma, In PHP both foreach loop and while loop seem to do exactly the same thing in this situation:
foreach($execute->result as $item){
echo $item['user_pass'].'<br />';
}
AND
while($row = mysqli_fetch_assoc($execute->result)){
echo $row['user_pass'].'<br />';
}
My question is are there any real differences...? when would be better to use one over another or is it fine to use both....? Does any of these two give you potential greater felxebility...?