Forum Moderators: coopster

Message Too Old, No Replies

Pictures and data from a database in the same php file?

         

zenon84

11:30 pm on Jan 23, 2009 (gmt 0)

10+ Year Member



Hello.

Is there a way to show in one php file an image from a database and below the picture, show some other attributes from the same database, like integer or varchar?

I need this in order to show in one window of browser pictures and data from the database.

I would very glad if someone help me as soon as possible!

Thank you very much!

Shores

4:14 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



You have only two ways of showing images in a web page using a IMG tag:

1) the IMG tag has a src attribute which points to the URL of the image (and that could also be a php file which reads the image from the db and sends it out)

2) the IMG tag has a src attribute that points to an attached image, which you should then attach to the main html file just as you do in HTML emails.

But this second method doesn't function well, so you'll better resort to the first one.

zenon84

4:23 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



Hello.

Thank you very much for your answer! You are very informative!

Have a good afternoon!

Thanks again!

Shores

4:24 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



You're welcome!

coopster

7:02 pm on Jan 26, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, zenon84.

1) the IMG tag has a src attribute which points to the URL of the image (and that could also be a php file which reads the image from the db and sends it out)

Do not forget to send out the appropriate mime type header first!

zenon84

7:22 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



Thank you coopster for the welcome note and for your precious help!
I appreciate it!

Have a peaceful night!