Jump to content

[SOLVED] Showing blank for NULL values


Recommended Posts



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>'); 
   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>');


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>');


How do I show a blank field if the value sin the database are blank?

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.