SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Luton, UK
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Putting images into a database

    Hi All
    I wondered if anybody knew of a good tutorial on how to put images into a database and then pull them and format them into a web page. Basically I want to do a star rating system like Amazon does on their customers reviews.

    Thanks for any help

    Drew
    'As a computer, I find your faith in technology amusing'

  2. #2
    SitePoint Zealot
    Join Date
    May 2001
    Location
    UK
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Drew,
    You wouldn't actually store the image in the datebase, just the file name.

    Here is another post you might find helpful
    http://sitepointforums.com/showthrea...threadid=29454

  3. #3
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is possible to store an image in a database using the BLOB (Binary Large OBject) field, but it's generally not recommended. As MPK pointed out a more popular way is to store the image on the web server and put the path to the image in the database.

    However... creating something like the Amazon star rating system shouldn't require any images to be put in a database at all. You should be able to store the number of stars as a number in the database, then have some PHP logic which repeats the HTML image tag for the "star" graphic enough times to represent the star rating. Much simpler

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Luton, UK
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey guys - thanks for your help. I'll give the link option a try as I am new to PHP I don't think I'm up to doing logic things!!

    Cheers
    Drew
    'As a computer, I find your faith in technology amusing'

  5. #5
    SitePoint Enthusiast eastern_star's Avatar
    Join Date
    Jul 2001
    Location
    east
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not directly related, i know..

    sometimes you can keep the sizes of images (width=65 height=88) in a database which can be very useful in some situations, like generating pop-ups


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •