Jump to content

[SOLVED] Query code and echo'ing results


acctman

Recommended Posts

Does this query code look right? I'm trying to pull all mp3 entries for user "m_id" and then display the results in a list.

 

<?
$mp3user = mysql_query("SELECT `mp3_id`,`mp3_userid`,`mp3_title` FROM `rate_mp3s` WHERE `mp3_userid` = 'm_id'");

echo "<ul>\n";
while($row = mysql_fetch_array($mp3user)) {
echo "<li>".$row['mp3_id']. "-" .$row['mp3_userid']. "-" .$row['mp3_title']."</li>\n";
}
echo "</ul>\n";
?>

 

output should be

 

  •   101-2332-Tile1
  •   102-2332-Tile2
  •   103-2332-Tile3
  •   104-2332-Tile4

 

Link to comment
https://forums.phpfreaks.com/topic/67076-solved-query-code-and-echoing-results/
Share on other sites

thanks everyone, coding works. one other question how do i do a Count 1 2 3 output for each line print?

 

i.e.

MP3 1: Unknown MP3 Title | Delete

MP3 2: Unknown MP3 Title | Delete

MP3 3: Unknown MP3 Title | Delete

 

right now, its printing

MP3 : Unknown MP3 Title | Delete

MP3 : Unknown MP3 Title | Delete

MP3 : Unknown MP3 Title | Delete

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.