Now, I know this doesn't exist in PHP but I'm struggling to think of a way of doing it.
I have read that the easiest way of achieving this is by nesting a While loop in an IF ELSE statement??
Here's my code
Code:
$query = "select *,date_format(dateadded , '%W %e %M') as fDate from aboutcontent where page='press' and datestart<=CURDATE()";
$result = mysql_query($query);
if ( $pagerow >= 1 ) {
while ($row = mysql_fetch_assoc($result)) {
$row['dateadded'] =& $row['fDate'];
echo '<div><strong>'.$row[title].'</strong></div>';
echo '<div style="font-size:12px;">'.$row[dateadded].'</div>';
echo '<div style="font-size:15px;">'.$row[content].'</div>';
echo '<br />';
}
} else {
echo 'You have no stories to display.';
}
But this seems to always show the ELSE echo??
What is the best way of achieving this?