im trying to display a link as an image or url on a page only when the URL record exists in my database. If there is no URl in the dsatabase i dont want the url/image to display on the page. I have dynamic pages for a catalogue and only want urls to appear on the pages for products that i have a url for them.
At the moment i can only get it to render an image for all occasions but this is no good. Im doign something like this but as i said i only want it to display something if i have a URL and not display anything if i dont.
function getURL($ID)
{
$sql = "SELECT URL etc
if ($recordSet === false)
{
log_error($sql);
}
while (!$recordSet->EOF)
{
$URL = make_db_unsafe ($recordSet->fields[URL]);
$recordSet->MoveNext();
} // end while
echo " <a href=\"$URL\"><img src=\"/gazania.jpg\" border=\"0\"></a><br>";
} // function display url
anyone help me..??
thanks..