PHP Syntax of an href with row variable

user308908

I am a newbie trying to write some php code and I am having some issues with the else statement.I believe it to be the href part that is throwing the error because it seems to work well until I add the href. I don't understand what is missing but at this point I have looked at the code so much.It could be obvious and I wouldn't see it. I would like to have the Link_ID row concatenate with the http link

if(empty($row['Link_ID'])){
   echo "<td>" . $row['Song'] . '&nbsp &nbsp &nbsp' . "<img src=GoButton-grey.gif></td>";
}else{ 
   echo "<td>" . $row['Song'] . '&nbsp &nbsp &nbsp' . <a href="www.imdb.com/' . $row['Link_ID'] .'"> "<img src=GoButton.gif></a></td>";
}

Any help would be greatly appreciated. Thanks

hardik solanki

You code should be :

if(empty($row['Link_ID'])){

echo "<td>" . $row['Song'] . '&nbsp &nbsp &nbsp' . "<img src=GoButton-grey.gif></td>";

}else{ 
    echo "<td>" . $row['Song'] . "&nbsp &nbsp &nbsp <a href='http://www.imdb.com/".$row['Link_ID']."'> <img src=GoButton.gif></a></td>";
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related