Jump to content

Need help with MySQL Case statements


Recommended Posts

Ok new to PHP. I've done this before with MSSQL but having a hard time in php.

[code]select (case when collectionImg = '' then '' else '<img src=' collectionImg '><br>' end) as collectionImg[/code]

Basically I want it to check to see if there is a collectionImg. If there is, build the html for me, if not do nothing. Everything works except it doesn't display the collectionImg variable. How do I need to format that part (collectionImg) to get it to work?
Link to comment
https://forums.phpfreaks.com/topic/10200-need-help-with-mysql-case-statements/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.