bravo14 Posted July 1, 2008 Share Posted July 1, 2008 Hi If you have a look at www.yardleyheroes.co.uk/fixtures.php you will see a list of fixtures, however the results are empty in the database, but they show as a zero $result = mysql_query('SELECT * FROM `fixtures` ORDER BY `date`', $con) or die(mysql_error()); if(mysql_num_rows($result) < 1) { echo('<tr class="profiletext"><td colspan="7">Sorry, no results were found.</td></tr>'); } else { while($row = mysql_fetch_array($result)) { if ($row[HomeAway]=="Home") { echo ('<tr><td>'.$row[Date].'</td><td><b>Yardley</b></td>'); echo ('<td align="center">'.$row[yardley_goals].'-'.$row[opposition_goals].'</td><td>'.$row[Opposition].'</td>'); echo ('<td></td><td></td><td><a href="http://www.yardleyheroes.co.uk/matchfines.php?match_id='.$row[match_id].'">View Fines</a></td></tr>'); } else{ echo ('<tr><td>'.$row[Date].'</td><td>'.$row[Opposition].'</td>'); echo ('<td align="center">'.$row[opposition_goals].'-'.$row[yardley_goals].'</td><td><b>Yardley</b></td>'); echo ('<td></td><td></td><td><a href="http://www.yardleyheroes.co.uk/matchfines.php?'.$row[match_id].'">View Fines<a></td></tr>'); } } } mysql_close($con); ?> How do I show a blank field if the value sin the database are blank? Link to comment https://forums.phpfreaks.com/topic/112793-solved-showing-blank-for-null-values/ Share on other sites More sharing options...
bravo14 Posted July 1, 2008 Author Share Posted July 1, 2008 Just cracked it, sorry if I have wasted anybody's time, still learning Link to comment https://forums.phpfreaks.com/topic/112793-solved-showing-blank-for-null-values/#findComment-579297 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.