Ask a question »

Transform an image field in SQL

June 2013


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.

Published by aakai1056
This document entitled « Transform an image field in SQL » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.
Receive our newsletter

health.kioskea.net

Inserting visitors counter on your webpage?
Unable to access Microsoft website