Hi Guys,
I was wondering if someone could help me with my query below as I can’t see why it’s not working.
Now I want to:
[b]GET the current story_id of the story the user is browsing and if there is nothing in the database row for manual_link_one_txt or manual_link_one_url or manual_link_two_txt or manual_link_two_url then output the message ‘Sorry, there are no related stories’ if these values are empty
However, if any of these columns are empty the system does not show the message – it just outputs two dot.jpg’s?
Any help most appreciated.
Thanks
Chris
[code=php]
<?
$query = “SELECT manual_link_one_txt, manual_link_one_url, manual_link_two_txt or manual_link_two_url FROM cms_stories where story_id=”.$_GET[‘story_id’];
$result = mysql_query($query) OR die(mysql_error());
$defineResults = mysql_num_rows($result);
if (empty($defineResults)) {
echo (“<DIV ALIGN=”CENTER”><strong><font size=’1′ face=’Verdana, Arial, Helvetica, sans-serif’>Sorry, there are no related
stories</font></div>”);
} else {
while($row = mysql_fetch_assoc($result)) {
echo ” <img src=’../images/story_images/dot.jpg’ width=’10’ height=’10’ align=’absbottom’ /><strong><font size=’1′ face=’Verdana, Arial, Helvetica, sans-serif’><a href='{$row[manual_link_one_url]}’>
{$row[manual_link_one_txt]}</a></font></strong><br />
<img src=’../images/story_images/dot.jpg’ width=’10’ height=’10’ align=’absbottom’ /><strong><font size=’1′ face=’Verdana, Arial, Helvetica, sans-serif’><a href='{$row[manual_link_two_url]}’>
{$row[manual_link_two_txt]}</a></font></strong <br />”;
}
}
?>