Answer the question
In order to leave comments, you need to log in
How to write a for loop correctly if we output data from MySQL?
Hello! There was a task to withdraw data from the database (MySQL) in a loop, I used the while loop, everything turned out:
while ($res = mysql_fetch_assoc($dbProject)) {
echo '<pre>
'.$res['id'].'
'.$res['number'].'
'.$res['status'].'
'.$res['header'].'
'.$res['description'].'
'.$res['level'].'
'.$res['customer'].'
'.$res['prioritet'].'
</pre>';
}
for ($sum1=0; ?????? ; $sum1++) {
echo '<pre>
'.$res['id'].'
'.$res['number'].'
'.$res['status'].'
'.$res['header'].'
'.$res['description'].'
'.$res['level'].'
'.$res['customer'].'
'.$res['prioritet'].'
</pre>';
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question