Categories > TinyButStrong general >

Coditional display from mysql

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: ovi2ut
Date: 2005-03-22
Time: 13:41

Coditional display from mysql

How can a I make a conditional display using data taken from a mysql database?

What  I want is to display an image (the <img src='' ...> tag) only if a field from the database is set to 1 (if is set to 0, this code shouldn't be display).
By: Skrol29
Date: 2005-03-22
Time: 14:27

Re: Coditional display from mysql

Hi,

The best way to do this is to use parameter 'magnet'. But parameter 'magnet' doesn't work with {value=1} neither with {value<>0}, but only with {value=''} (empty string, or null).
So if you can make some way your flag to be '' or null when you don't want the image, then it is perfect. You can do that with you SQL statement, or using parameters 'if', 'then'.
By: ovi2ut
Date: 2005-03-23
Time: 09:22

Re: Coditional display from mysql

Thank you!

It works!