while()
Posted: Thu Dec 03, 2009 2:53 pm
Here I am again.
I'm trying to while() loop 20 rows of data in MySQL. I want it to be displayed in a table using the while() loop, yet when I use it, it just repeats the same line over and over again. How can I fix this? (the table is already declared)
I'm trying to while() loop 20 rows of data in MySQL. I want it to be displayed in a table using the while() loop, yet when I use it, it just repeats the same line over and over again. How can I fix this? (the table is already declared)
Code: Select all
echo('<br />
<tr><th>Author</th><th>Quote</th></tr>');
while($quote_list_result = $db->fetch_array($db->query_read("SELECT * FROM quote ORDER BY id ASC"))) {
echo('<tr>');
echo('<td>' . $quote_list_result['author'] . '</td>');
echo('<td>' . $quote_list_result['text'] . '</td>');
echo('</tr>');
}