at least i think thats what the problem is
[code=php]
<?php
$pieces = mysql_query(“SELECT * FROM `pieces` ORDER BY `date_submitted` DESC”);
?>
Newest Pieces:
<?php
$i = 0;
while($piece = mysql_fetch_array($pieces, MYSQL_ASSOC) && $i <= 5){
echo mysql_error();
?>
<a href=”view.php?id=<?php echo $piece[‘id’] ?>”><?php echo $piece[‘piecename’] ?></a> by <?php echo $piece[‘artist’] ?>
<br />
<?php
$i++;
}
?>
i get the line breaks and the empty links, so basically its not getting the stuff from the db in there. ran mysql_error, nothing. maybe while doesnt want me to stick something else in there with the mysql_fetch_Array? if so, any suggestions for another way to do this? all i want to do is get the 5 newest pieces in descending order of newness. is there a way that i can even put in the SQL statement “only grab a max of 5 rows”