Hi all,
I have an events table in my database that I’m displaying on a page.
<?php
//$today = date("w");
$query1 = "SELECT * FROM events";
$result1 = mysql_query($query1);
while($row = mysql_fetch_array($result1)){
echo "<strong>".$row['title']."</strong><br />".$row['description'];
}
?>
There is also a field in the table for url but not all records have a url.
What I want to do is wrap an href around the description but only if that ID has a url associated with it.
If I do this it adds an href whether it has one or not. (Excuse the syntax if I’m off a little bit.:))
echo "<strong>".$row['title']."</strong><br /><a href='.$row['url'].'>".$row['description']."</a>;
Any one have any ideas? I figure a loop would work but I don’t know how to implement it here.