Hello everyone, hopefully someone can help me with this.
I have a custom view where the value are 4 songs separated by a comma, i tried to select each song and display the song as a link to download the lyrics with a while loop the problem here is that the var $value only shows the las iteration of the loop but if i echo the var $value it shows all the iterations and it is actually right here is the code
$arr = explode(",",$value);
$count = count($arr) - 1;
global $conn;
$i = 0;
while($i <= $count){
$sql = "SELECT song_id,song FROM songs WHERE audio = '".$arr[$i]."'";
$res = db_query($sql,$conn);
$row = db_fetch_array($res);
$value = '<a href="download.php?table=songs&field=lyrics&key1='.$row['song_id'].'">'.$row['song'].'</a> ';//this only shows the last song.
echo $value;// this shows all 4 songs with its respectives links to download.
$i++;
}
Thanks