Forums
This topic is locked
Show if recordset is not empty server behaviour
Posted 16 Jan 2004 13:29:31
1
has voted
16 Jan 2004 13:29:31 Alan Morris posted:
I have tried to use this behaviour but it doesnt work. I have image fields that if not empty should not show, trouble is they do creating an empty image space.look at www.dordogneholidayhomes.co.uk/description.php?id=6 to see what I mean. There are only 2 pictures in the database for this site but an extra 4 empty 4 image fields appear.
Anyone no why this doesnt work?
Replies
Replied 18 Jan 2004 17:41:41
18 Jan 2004 17:41:41 Phil Shevlin replied:
Well it means that the recordset is not empty. We would need to see the data structure and the code used. Also, your site is not showing well at 800*600
Replied 19 Jan 2004 19:51:17
19 Jan 2004 19:51:17 Dan Berdusco replied:
You need to code an "IF Statement" around each of the images to check to see if the field of the recordset is empty. Not the whole recordset. I have no Idea how to code in PHP but the general idea is this:
--------------------------
If recordsetname.imagefieldname <> "" then
Image here
End If
--------------------------
So, for each image you check to see if the field that stores the name of the image is blank. If it isn't blank, then you show the image. If it is blank, then the image will not show.
Hope that helps...
--------------------------
If recordsetname.imagefieldname <> "" then
Image here
End If
--------------------------
So, for each image you check to see if the field that stores the name of the image is blank. If it isn't blank, then you show the image. If it is blank, then the image will not show.
Hope that helps...