#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London, England
    Posts
    16
    Rep Power
    0
    I want to associate keywords with images in my image DB. Im wondering what table structure would be best.

    There would be around 10 keywords per file. I want to be able to perform searches such as:

    .all images with keywords 'mike'
    .all images with keywords 'mike' and 'jane' and 'tom' and 'chloe'

    Do i have:

    |filename | kw01 | kw02 | kw03 | ..
    or something like
    |filename | keywords |
    or

    im thinking about simplicity, basically the best way to do it.

    sanners./
    [newbie to all this]

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London/UK
    Posts
    91
    Rep Power
    14
    Hi Sanners

    I'd suggest 2 tables

    1) your images, with related info
    2) a keyword lookup table with only two feilds, keyword and imageID

    this is scaleable as you can have, say 50 keywords for one image and only 2 for another, it'll also make searchng much easier

    take a look @ the article about DB normalising on phpbuilder.com

    regs

    Bealers

    ------------------
    http://back-end.org
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London, England
    Posts
    16
    Rep Power
    0
    Ok, my current design is pretty much along the lines of whatyou suggest but..

    I was thinking about when i have to search. I confused as to how i would perform my search if the keywords 'mike, jane, matt' where all under keyword.

    To put it another way, how would i perform the substring search on the keywords for an image to see if they contained the names i was looking for.

    If there was only one word i would use "select filename from table where keyword='mike'" but because keywork now contains more than one name ('mike','tom','jane') im a little confused.

    Am i making myself clear? Hmm, i guess we'll see..

    thanks in advance.

IMN logo majestic logo threadwatch logo seochat tools logo