Why is my list function only outputting first value of my array?
I'm still a php novice...I apologize if this is a silly question.
I have an array of numerical values ('views'), each 'view' specific to a
video. I want to output the top 'views' into cells of a table (html).
Whether my list is ascending or descending, I continue to only see the
first number (but the correct number) of the list ($views1 in the first
row). Here is my code:
<? php //lots of code, followed by
include 'connect.php';
$views=mysql_fetch_array(mysql_query("SELECT video.views FROM video ORDER by
video.views DESC LIMIT 10"));
list($views1,$views2,$views3,$views4,$views5,$views6,$views7,$views8,$views9,$views10)
= $views;
?>
<html>
<body>
<table>
<tr><td><?php echo $views1 ?></td></tr>
<tr><td><?php echo $views2 ?></td></tr>
. //My actual code has 10 rows going from $views1 to $views10
..
..
<tr><td><?php echo $views10 ?></td></tr>
</body>
</html>
I just cannot see what the problem is...thanks for any help!
No comments:
Post a Comment