echo "<a href=\"{$row['link']}\" class=\"button\">Website link</a>";
This will display an an anchor tag with a class of "button" and the href value will be whatever is in the database. If I don't have a link stored in the database, I want nothing to appear in the rendered html, but with this example the button will still show up, it just won't have an href value.
I've tried doing this:
echo "{$row['link']}";
And in the database, the 'link' value would be:
<a href="#" class="button">Website link</a>
My issue with this is that I don't like storing and pulling html code from the database. Also, if I leave the link value empty in the database, part of the button is still visible because of the "button" class.