This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > August 2004 > Selectively displaying dynamic text





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Selectively displaying dynamic text
megajam02

2004-08-03, 12:14 pm

Ok, this has been driving me nuts for a couple of days.

Lets say, for example the I have 4 columns in my recordset -

id, event_name, event_location, event_charge

Now, I want to query the table and display the records with dynamic text on a
page like so:

Event Name: User Group Meeting
Event Location: Hawaii
Event Charge: $100

If there is no value in the event_charge field, I'd like to not display either
the value or the label on the page, because it's just not needed. I have been
able to figure out how to not show the entire row if something is blank, but
can you point me in the correct direction for not showing a particluar column
of a row. Oh, and I'm using PHP.

Does this make sense?

Thanks,
Chris

Murray *TMM*

2004-08-03, 12:15 pm

Test the field, and only write the label and value if it's not empty.

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"megajam02" <webforumsuser@macromedia.com> wrote in message
news:ceo55a$bij$1@forums.macromedia.com...
> Ok, this has been driving me nuts for a couple of days.
>
> Lets say, for example the I have 4 columns in my recordset -
>
> id, event_name, event_location, event_charge
>
> Now, I want to query the table and display the records with dynamic text

on a
> page like so:
>
> Event Name: User Group Meeting
> Event Location: Hawaii
> Event Charge: $100
>
> If there is no value in the event_charge field, I'd like to not display

either
> the value or the label on the page, because it's just not needed. I have

been
> able to figure out how to not show the entire row if something is blank,

but
> can you point me in the correct direction for not showing a particluar

column
> of a row. Oh, and I'm using PHP.
>
> Does this make sense?
>
> Thanks,
> Chris
>



megajam02

2004-08-03, 7:15 pm

Murray,
I'm fairly new to php. Well, let me be honest. I'm new to web development in
general.

Can you give me some sample code? I'm not sure what you mean by testing the
field. I'm assuming an if/else statement? I am a bit familiar with that,
however, I'm not familiar with how to display the field and label only if the
value is empty.

Murray *TMM*

2004-08-03, 11:14 pm

mega:

I don't do php, but here is ASP VBScript kinda pseudo-code (assuming your
label and your value are in adjacent table cells)...

<% if fieldname.value<>"" %>
<td>Label</td>
<td><%= fieldname.value %></td>
<% else %>
<td>&nbsp;</td><td>&nbsp;</td>
<% end if %>

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================

"megajam02" <webforumsuser@macromedia.com> wrote in message
news:ceokug$203$1@forums.macromedia.com...
> Murray,
> I'm fairly new to php. Well, let me be honest. I'm new to web development

in
> general.
>
> Can you give me some sample code? I'm not sure what you mean by testing

the
> field. I'm assuming an if/else statement? I am a bit familiar with that,
> however, I'm not familiar with how to display the field and label only if

the
> value is empty.
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews