Jump to content

display image if field =


adzie

Recommended Posts

ok if you have the url in a field then thats all good

set the url to a variable so like $url

 

then do the regular image thing with HTML

 

so like <img src="$url">

 

(I think)

 

so

 

if ( field = 1 ) {

<img src="$url">

} else {

echo "you do not have priviledges to have a picture";

} ;

Link to comment
Share on other sites

thanks lokolo i'm looking to have various fields dictating which group a member belongs to, ie 1 if they are 0 if not.

 

so i want it to display a image dependent on the group.

Link to comment
Share on other sites

$query = "SELECT flights.IMAGE

INTO  FLIGHT_IMAGE

FROM  members,

      flights

WHERE  flights.FLIGHT = members.FLIGHT

AND    members.VID      = VID";

 

This is the code I've been given to extract an image dependent on the user ID

 

an example of table below

 

members table

VID  -- this identifies the person

FLIGHT -- The group they belong to

 

flight table

 

FLIGHT -- the flight group

IMAGE -- the url to the image.

 

now assumin this works how can I get the image to display on the screen next to my form fields and will this code pick the correct image for the group?

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.