in reply to CGI-SQL-HTML-Display "no image"

You can have an extra (boolean) field in your database which indicates whether or not there is a photo available.

It will save you the time-consuming task of checking through the file-system whether a file is available.The "dark side" of this solution is of course that you must keep you data-base updated. There is no gain without pain.

Or you can have a "default image" on the file system for each entry, which shows something like "no picture available yet" and when the "real" photo is put in the file-system it will automatically overwrite the default image.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Replies are listed 'Best First'.
Re: Re: CGI-SQL-HTML-Display "no image"
by WhiteBird (Hermit) on May 24, 2003 at 15:05 UTC
    Thanks for the reply. Sadly, I can't touch the structure of the database. Fixing the problem at the source would be the way I would do it if I could.

    Default image is a good idea. Laziness keeps me from wanting to create a separate image for each missing photo, though. (We're talking a hundred or more photos.) If I can think of a way to automate the process, all the better. There must be a module or something out there that would create repetitive images?

      Read the original reply by Zaxo more closely. You don't need a default image for every missing image...you just need one for all the missing images. That's what Zaxo's code above demonstrates.

      Mark

        Thanks, Mark. I realize that, and I agree that Zaxo has the better suggestion. I'm just gleaning ideas though, and creating separate images to link to would be another way to do it, would it not? (One that I'm too lazy to pursue except as a last resort.) I was merely pondering that if one had to do it that way, then there must be some way to make even that painful task easier.