I want the PDF field to be hidden when the PDF Field is empty, I've search this forum and many others and the more I read the more I get confused !
I've marked the area in question with ==== before and after !
Here is my code:
<?php
$id = $_GET['id'];
if(empty($id))
    header('Location: news.php');
else
{
    mysql_connect('localhost','root','usbw');
    mysql_select_db('flexphpdir');
    $query = mysql_query("Select * From linkex WHERE linkexid = '$id'");
    if($query === false)
    {
        var_dump(mysql_error());
    }
    else
    {
        while($output = mysql_fetch_assoc($query))
        {
?>
            <video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="320" height="184" data-setup="{}">
                <?php echo $output['title']; ?><br>
                <?php echo date('d-M-Y', $output['adddate']); ?><br>
                <?php echo $output['weekid']; ?>
                <source src="contentuploads/<?php echo $output['video']; ?>" type="video/mp4" />
            </video>
            //================================      
            <?php  if (get_field('pdf') != "")  { ?>
                //code if field has value ! = <?php echo $output['pdf']; ?> 
            <?php } else { ?>
                //code for no field value here
            <?php } ?>
            //=================================
<?php
        }
    }
?>
<?php } ?>
 
     
     
    