peppeto wrote:I think you men this
if($link !=""){
$link = $link;
}else{
$link = "SOmething here";
}
echo "<p><a href='$link'>Click here for more info </a></p></td>"
Ok so If I was to use that then should there be no info for link in mysql database, I can put in what ever I want right. So link it to a page not available....
This is usefull thanks but let me put this into an example. In the following echo I have a table with multple cells. The bottom cell is there to display a link. However if this link is not available in mysql I would like for the link not to display at all.
As it stands it looks like this:
while ($row = mysql_fetch_array($result)){
$header = $row['header'];
$content = $row['content'];
$link = $row['link'];
echo "<table width='90%' border='1' cellspacing='0' cellpadding='5'>
<tr bgcolor='#006699'>
<td width='150'><span class='style1'>Header Img </span></td>
<td><span class='style1'>$header</span></td>
<td width='150' align='right'><span class='style1'>Date Posted </span></td>
</tr>
<tr>
<td colspan='3'align='left'>$content</td>
</tr>
<tr bgcolor='#C1EBFF'>
<td colspan='3' align='right'>"<p><a href="$link">Click here for more info </a></p>";
}
?>
So how can I only display a link if there is one available?