I have a database that contains rows with links to each episode in them. I am trying to use the below code to get all the links for one type of show and I manage to do that successfully. What I can't seem to figure out is how I can get just one of the rows to display rather then having them all display in a single line of text so I could use them in building my page.
$query = "SELECT direct_link FROM episode_link WHERE anime_id = '$animeid'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$dlink = $row['direct_link'];
echo $dlink;
}
Currently it's displaying them all like this.
link1link2link3link4link5link6
I would like to be able to display them one at a time or put assign variables to them so I can put them in href tags on my site. I thought I could do this by using $row[1] but that does not display anything.
Sorry if I made it hard to understand, new to php so I am still learning.