php/mysql noob with question. MYSQL does not seem to have a preferred way to store boolean values. I decided to go with Tiny(int) at the suggestion of someone on a message board who said this is equivalent to True/False. I would think that True =1 and False =0...maybe that's assuming to much... Anyway put 1 values in mysql dbase for testing. They showed up in phpAdmin as "1" for what that's worth.
I'd like to retrieve these values and if TRUE show picture and if false, not show it. So after connecting with dbase and running successful query that returns other text values fine, I wrote...
if ($row['email'] == TRUE)
{
echo "<img src='images/email.png'>";
}
Alternatively in place of TRUE, I've tried 1, '1' "1" 'TRUE' etc.
If I just echo $row('email'), I get 1. However, the above logic does not work. The condition is never meant and the image never shows. I tried turning it around with != but still can't get it to work. From what I've read, booleans in MYSQL can be a bit flaky but this seems pretty basic.
Note. With above code, there is no error. It just never evaluates the statement in parentheses as true to execute conditional. Could it be a syntax error??? or what am I missing.
Thanks for any suggestions!
var_dump($row['email'])result in?echobefore theif.