Page 1 of 1

Can you use PHP to show a default image if the image field

Posted: Thu Jul 26, 2007 5:37 am
by aris1234
Can you use PHP to show a default image if the image field in a database row is empty?

I'm creating a news page, but the client may not always upload an image with a news story. I know how to hide the area, but this leaves a big blank space. It would be much better if a default image were to appear.

Posted: Thu Jul 26, 2007 5:43 am
by volka
All it takes is an if construct

Posted: Thu Jul 26, 2007 6:22 am
by onion2k
It'd be better to do that with a database level 'if' I reckon.