Forums
This topic is locked
Optional display results
Posted 26 Aug 2006 19:50:32
1
has voted
26 Aug 2006 19:50:32 ken Waagner posted:
<font face='Arial'>I am working on a ticketing page for one of my clients, and have a field called "ticketinfo" where i display micellaneous information. I would like to make it where this field will only display if it is not NULL, but, cannot seem to figure out how to do this and have been Googling for the past 24 hours... the page is here: wilcoworld.net/tours/index_dyn.php
the code for the block is here:
<?php do { ?>
<tr align="center" valign="middle">
<td height="20" align="right" bgcolor="#333333" class="tixtext"><?php echo date ("M-j", strtotime($row_rs_dates['show_date'])); ?></td>
<td width="280" align="left" bgcolor="#333333" class="tixtext"><?php echo strtoupper($row_rs_dates['show_city']); ?>, <?php echo strtoupper($row_rs_dates['show_state']); ?></td>
<td width="280" align="left" bgcolor="#333333" class="tixtext"><?php echo strtoupper($row_rs_dates['show_venue']); ?></td>
<td width="80" bgcolor="#333333" class="tixtext"><a href="<?php echo $row_rs_dates['ticket_url']; ?>" target="_blank"><img src="images/buy.gif" width="78" height="18" border="0"></a></td>
</tr>
<tr align="center" valign="middle">
<td align="right" class="tixtext"> </td>
<td colspan="3" align="left" bgcolor="#333333" class="tixtext"><?php echo $row_rs_dates['ticket_info']; ?></td>
</tr>
<?php } while ($row_rs_dates = mysql_fetch_assoc($rs_dates)); ?>
Any help would be greatly appreciated.
Thanks.
Ken
</font id='Arial'>
Replies
Replied 29 Aug 2006 14:00:08
29 Aug 2006 14:00:08 Roddy Dairion replied:
well may be you could try it with an if else statement. for e.g.
if ($row_rs_dates['ticketinfo'] != ""
{
echo $row_rs_dates['ticketinfo'];
}
else
{
echo "";
}
if ($row_rs_dates['ticketinfo'] != ""
{
echo $row_rs_dates['ticketinfo'];
}
else
{
echo "";
}