Transform an image field in SQL
Issue
My question is quite simple I have a database in SQL / PDP
In my db I have some basic fields, but I want my display's field "yes" (eg) turns into a picture on the web ....
Such as:
If field = "Yes" displays: images.jpeg
If field = "No" poster: images_non.jpeg
Solution
It is not complicated, when you read the contents of the table to display you do a test:
if($data ['field_yes_no']== 'Yes'){
echo '< img src="images.jpeg " ......... >';
}elseif($data ['champ_yes_no']== 'No'){
echo '< img src="images_non.jpeg " ........ >';
}
Note
Thanks to Alai_42 for this tip on the forum.
See also
Knowledge communities.