wwfc_barmy_army Posted November 5, 2006 Share Posted November 5, 2006 Hello. I have this in my php code:[code=php:0] <?phpif ($artist == ""){print "Please select an artist:<br/>"; $result = @mysql_query("SELECT * FROM artist"); $row = mysql_fetch_array($result);print "<a href=index.php?artist=$row[artist_id]>$row[name]</a>";}?>[/code]I want to return all the rows in the table artist but it's only returning the first one. How can i make it return all?Thanks Quote Link to comment Share on other sites More sharing options...
A3aan Posted November 5, 2006 Share Posted November 5, 2006 You have to loop the query result.[code]while ($row = mysql_fetch_assoc($result)) {echo "<a href=index.php?artist=".$row[artist_id].">".$row[name]."</a>";}[/code] Quote Link to comment Share on other sites More sharing options...
wwfc_barmy_army Posted November 5, 2006 Author Share Posted November 5, 2006 ahhh, i see. ::)Thanks! :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.