Forums

PHP

This topic is locked

empty fields

Posted 27 Aug 2001 20:38:07
1
has voted
27 Aug 2001 20:38:07 Keith Slater posted:
Hello again! I need to find a way so if some one leaves a field blank and that one field is blank in the database it wont show anything on the page it displays on. So say the field they leave empty is a picture field... If they don't select a picture currently it acts like a dead picture is their a special show region thats not just for the recordset but for a field


thanks

Keith Slater

Replies

Replied 27 Aug 2001 23:51:51
27 Aug 2001 23:51:51 Bruno Mairlot replied:
Hi Keith,

I'm sorry, but I don't fully understand what you exactly want to do <img src=../images/dmxzone/forum/icon_smile_blush.gif border=0 align=middle>

Could you please, explain a little more, cause I have the feeling that I can help you, but I'm not sure how exactly.

If you use conditional region, where the condition is based on the value of the field, shouldn't it work ?

let's suppose you'll have something like this :

<pre id=code><font face=courier size=2 id=code>
&lt;?php
if($Recordset1-&gt;Fields("Picture"!=""{
?&gt;
<i>// Show picture here</i>
&lt;img src="&lt;?php echo $Recordset1-&gt;Fields("Picture"?&gt;"&gt;
&lt;?php
} else echo "&nbsp;";
?&gt;
</font id=code></pre id=code>

Bruno

"First they laugh at you, then they fight you, then you Win..." Ghandi
Replied 28 Aug 2001 14:57:02
28 Aug 2001 14:57:02 Keith Slater replied:
ok let me show you, go to www.finaltribute.com/FindAnObituary.php and click on Erma Mae Jones. If you scrolls down to the bottom it says blank, I need a away so that if the perosn who submits the form doesnt select anything to go there, nothing shows up.

thanks again

Keith Slater
Replied 29 Aug 2001 13:58:02
29 Aug 2001 13:58:02 chief monkey replied:
What Maehdros says should work
&lt;?php
if($Recordset1-&gt;Fields("Picture"!=""{
?&gt;
//display code and picture
&lt;?
} else {
?&gt;
// display alternative code
&lt;?
}
?&gt;

Everybody has got to be somewhere

Reply to this topic