MichaelHooker
Programmer
After many hours of searching in books and on the net, I can't find the answer to this simple question. Maybe I'm using the wrong keywords to search under?
I pull out rows of data from my table in the usual way, ending up with the row I want to work with in array variable $row. The data are the details relating to a photo, shown as a thumbnail (not stored in the db). There are two buttons, for pulling up a small and a large-sized version of the photo respectively, but in some cases no large-sized version exists - the photo isn't clear enough to cope. In those cases the "large" button is enabled only "if (file_exists($path_to_image_file)) {...}". If the file does not exist, the button is greyed out.
This works surprisingly well, but to my mind it's clunky and disk-intensive. The alternative solution I have in mind is a new boolean column in my details table, true if a large image exists, else false. What I can't find out is what exactly ends up in the php array "cell" corresponding to the boolean field, and how to process it.
Would it be as simple as:
or do I have to look for the word "TRUE" or the letter "T" or something else?
Many thanks for the help.
Michael Hooker
I pull out rows of data from my table in the usual way, ending up with the row I want to work with in array variable $row. The data are the details relating to a photo, shown as a thumbnail (not stored in the db). There are two buttons, for pulling up a small and a large-sized version of the photo respectively, but in some cases no large-sized version exists - the photo isn't clear enough to cope. In those cases the "large" button is enabled only "if (file_exists($path_to_image_file)) {...}". If the file does not exist, the button is greyed out.
This works surprisingly well, but to my mind it's clunky and disk-intensive. The alternative solution I have in mind is a new boolean column in my details table, true if a large image exists, else false. What I can't find out is what exactly ends up in the php array "cell" corresponding to the boolean field, and how to process it.
Would it be as simple as:
Code:
if ($row[ColNo]) {
echo '<input type=button etc etc
} else {
echo '<input disabled type=button etc etc
}
or do I have to look for the word "TRUE" or the letter "T" or something else?
Many thanks for the help.
Michael Hooker