This is old and probably answered but I helped you with a similar problem a while ago. Use PHP, Try something like:
<?php echo "<img src='http://www.example.com/ads>ad=" . $fourteen . "'>";
Assuming your query is correct this will pull the value of $fourteen as defined by your query. without...