Skip to content
Advertisement

How can I make $row to real link

I have $row["vLink"] vlink(varchar(200)) is a URL address I got from MySQL. But when I’m printing vLink looks in text form not a real link. How can make a clickable IMG link with using vLink?

while ($row = mysqli_fetch_assoc($result)) {
    echo $row["vLink"];
}

Advertisement

Answer

To make clickable image

echo '<a href="'.$row["vLink"].'">'.' <img src="img_girl.jpg" alt="Girl in a jacket"> '.'</a>';

When you will click on image it will re-direct you to that link( $row[“vLink”] )

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement