Forums

PHP

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:

&lt;?php do { ?&gt;
&lt;tr align="center" valign="middle"&gt;
&lt;td height="20" align="right" bgcolor="#333333" class="tixtext"&gt;&lt;?php echo date ("M-j", strtotime($row_rs_dates['show_date'])); ?&gt;&lt;/td&gt;
&lt;td width="280" align="left" bgcolor="#333333" class="tixtext"&gt;&lt;?php echo strtoupper($row_rs_dates['show_city']); ?&gt;, &lt;?php echo strtoupper($row_rs_dates['show_state']); ?&gt;&lt;/td&gt;
&lt;td width="280" align="left" bgcolor="#333333" class="tixtext"&gt;&lt;?php echo strtoupper($row_rs_dates['show_venue']); ?&gt;&lt;/td&gt;
&lt;td width="80" bgcolor="#333333" class="tixtext"&gt;&lt;a href="&lt;?php echo $row_rs_dates['ticket_url']; ?&gt;" target="_blank"&gt;&lt;img src="images/buy.gif" width="78" height="18" border="0"&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr align="center" valign="middle"&gt;
&lt;td align="right" class="tixtext"&gt;&nbsp;&lt;/td&gt;
&lt;td colspan="3" align="left" bgcolor="#333333" class="tixtext"&gt;&lt;?php echo $row_rs_dates['ticket_info']; ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;?php } while ($row_rs_dates = mysql_fetch_assoc($rs_dates)); ?&gt;

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 "";
}

Reply to this topic