Aloha,
I am pretty new to php, and have some code that is working, but I want to only echo a field if there is data present in the MySQL field.
The database connection is set, and I am connecting to a particular row in a that a table. A number of fields (from that row) are echo'ed throughout the page...with this item "$youtube_url" I want to display the code below, if there is data in the database field....but if there is no data in the field i want none of the code to be displayed, including the html. I am pretty sure this will involve an "if-else" statement...right?
What I have:
<div class="module">
<h3>Video</h3>
<div>
<p><b>Watch the <a href="<?php echo $youtube_url; ?>">Video Tour</a></p>
</div>
</div>