Jump to content

reading images

- - - - -

  • Please log in to reply
3 replies to this topic

#1
mahboobsrd

mahboobsrd

    Newbie

  • Members
  • Pip
  • 1 posts
i have a database consisting of part number, item name, price. i want to save the pictures in images folder. when i am showing the products data with the above fields i also want to show the picture of the same. i am saving the picture in jpg format with partnumber as its name, please guide me on how to do this. i made the page with the above fields. its working fine. but what about the picuter how can i show it next to the other data of that record.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
The two likely options are either
  • Storing the image along with the other data, as a binary object (blob)
  • or
  • Storing the image path as a string along with the other data
The second should be more simple to implement, you would have to write an <img> tag to display the image with the image path you retrieve. The first will require a helper page to display the image, although will also be dynamic as the second one in terms of having to use image tags.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
Perhaps something like this?:
The Part's Picture: <img src="the_images_folder/<?php echo $part_number ?>.jpg"> 


#4
yassinebelkaid

yassinebelkaid

    Newbie

  • Members
  • PipPip
  • 20 posts
do you want to display the image from database or from a folder? if from the database, it's better to create a column for the path of the image, it means all you will get from the database is just the path where the image in, so that you can display it beside your other stuff dynamically. and you can use different images for different products.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users