/    Sign up×
Community /Pin to ProfileBookmark

Show/hide html table row if data is populates/unpopulated

I have a website hooked to an oracle database. I display different results from that database.

There is one field that occasionally will have data in it. I want to display a table row on screen containing that data ONLY if that specific DB field has data in it. If the field is empty I want to hide that additional table row?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@scragarApr 22.2005 — I'm not sure how to read/use oracle, so bare with me.

assuming you hold the value of this feild in the variable $txt:
[code=php]<?
while(your results loop has unread results){
//fill your vars or whatever.
if(!empty($txt)){
echo "<tr><td>yadda</td><td>$txt</td></tr>";
};
};
?>[/code]
Copy linkTweet thisAlerts:
@mikeyzcauthorApr 22.2005 — I'm not sure how to read/use oracle, so bare with me.

assuming you hold the value of this feild in the variable $txt:
[code=php]<?
while(your results loop has unread results){
//fill your vars or whatever.
if(!empty($txt)){
echo "<tr><td>yadda</td><td>$txt</td></tr>";
};
};
?>[/code]
[/QUOTE]


that will only show the row if there is data in the specified DB field?
Copy linkTweet thisAlerts:
@scragarApr 22.2005 — it should completely ignore the row if there is no value in that feild(which is what I think you want)
Copy linkTweet thisAlerts:
@mikeyzcauthorApr 22.2005 — it should completely ignore the row if there is no value in that feild(which is what I think you want)[/QUOTE]

yes, exactly. thank you for your help
Copy linkTweet thisAlerts:
@scragarApr 22.2005 — your welcome.
×

Success!

Help @mikeyzc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...