SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    May 2001
    Location
    x
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    struggling mysql newbie

    hey im trying to understand how to make a site with members, and artwork they want to share/display with other members.
    1) in mysql i make a table named "members".
    2) when a person joins my site, i should add a new row holding their id/pw/filename/file description..? right?
    3) later (this is where i get lost) when they want to upload a new image/etc where should i put this? ya see all im gathering this time is the filename. but i need to associate it with that user so i can display all their art on their homepage. how do i do this?
    4) should each member get a row to themselves? should they have a whole table? should i keep filenames in a seperate table and associate that table with their member table? aid.

    as you can see im struggling here. if you could answer some of my questions or even better point me to a tutorial that shows how to make such a site with users/uploads etc, id really appreciate it.

  2. #2
    SitePoint Zealot Overgrow's Avatar
    Join Date
    Jan 2001
    Location
    Your basement
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is an idea of what your schema should be:

    table Members {

    memberID, medint(8), Auto_increment, unsigned
    name, varchar (50)
    password, varchar (50)
    etc...

    }

    table Images {

    imageID, medint(8), Auto_increment, unsigned
    filename, varchar (250)
    imagename, varchar (50)
    memberID, medint(8)

    }

    Then to link up the images with that member posted it, use the memberID field. Here is a great article on database normalization that should help you figure out the rest:

    http://www.phpbuilder.com/columns/barry20000731.php3
    Overgrow the Government: The Edge Forums
    presented by Overgrow Marijuana Magazine

    *warning: adult content

  3. #3
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just FYI, http://www.digitalart.org is an awesome site for sharing graphics.

  4. #4
    SitePoint Zealot Overgrow's Avatar
    Join Date
    Jan 2001
    Location
    Your basement
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did I miss something? What does this thread have to do with digital art or sharing graphics or spam?
    Overgrow the Government: The Edge Forums
    presented by Overgrow Marijuana Magazine

    *warning: adult content

  5. #5
    SitePoint Member
    Join Date
    May 2001
    Location
    x
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi, thanks for your reply. Its starting to make some sense to me now =).
    a couple things though..in the commands above, with medint(8) i should make it mediumint(8) right? it gave me an error with medint(8).
    secondly, i cant seem to use auto_increment along with unsigned. it throws an error. any suggestions?
    thank you


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
  •