SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2002
    Location
    Asker, Norway
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    small images in mysql

    I have a member database with a table with one row for each person. But I want to store an image of each person.
    The way I see it i have three ways:
    The images will be around 75x50px and gif/jpeg

    1: I can make a new table to store pictures as binary data. and add a field in the user table to link to a picture

    2: since I only need one picture pr user I can add a few extra fields in the user table to store a picture as binarydata

    3: Store each picture in the filesystem, and the filename (and sizes) in the user table.

    Personally i think I would prefer 2, but I really ain't sure

  2. #2
    SitePoint Addict
    Join Date
    May 2004
    Location
    .
    Posts
    227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Personally I'd prefer to do it the second way you described.
    Ilya Devyatovsky
    ThinkHost, Inc.
    Wind/solar powered web hosting - 6 months free!

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    Erial, NJ
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know this is a bit dead, but I ran into the same problem before.

    I simply created a folder "People" in my images folder and named each persons picture as their name, exactly as typed in the database and wrote something like this:

    PHP Code:
    ...
    while(
    $row mysql_fetch_array($results)) {
    $name $row['name'];
    $stuff $row['stuff'];
    $stuff $row['stuff'];
    $stuff $row['stuff'];
    $stuff $row['stuff'];
    echo 
    '<img src=address/images/people/' $name '.jpg height="70" widht="75" />';

    kinda like that...


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
  •