#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    4
    Rep Power
    0

    Help understanding a solid way of adding and viewing member profiles.


    First of all thanks for checking out my thread! I'm new to web development(about 6 months) but I have a pretty solid grasp on Php,Html, MySQL,Css and I'm just starting on java script. I'm part of a Web app team at my tech center and we were given the task of creating a site to get kids active. We won at a regional level and where going to state in march.

    I want to allow the kids to add there friends and see what challenges they've completed and so on. But I'm having a tough time putting it all together. For instance should I have a MySQL DB full of who is friends with who? And should it viewing profile pages be JavaScript or php or maybe theres a better script?

    If this is the wrong section I apologize. I'm not looking for any code just trying to piece it together in my head.


    Thank you!;
    Travier
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,136
    Rep Power
    1990
    You'll need to track who is freinds with who somehow. The best way for this is a database. It can be done other ways like text files or XML but these are not good ideas because they are really only useful for small-scale applications.

    The viewing pages would be made with PHP to output the HTML. JavaScript is not able to do anything server-side (well, not easily so far) so these two languages are really used for different things.

    One big pint to remember is the privacy aspect of it all - especially when dealing with kids. Even something as innocent as sharing results like that can go bad if kids get together to gang up on others.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    4
    Rep Power
    0
    Thanks for the reply!

    But I defiantly agree with privacy I was kinda overlooking that. But thats something I really need to look into.

    And whats a good way to setup the mysql table? Something like this:
    Code:
    ID        FriendA       FriendB 
    23          Bob            Jim
    Where one row shows the relation between 2 members?
  6. #4
  7. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,136
    Rep Power
    1990
    For a friends table, you don't need quite that much info, but it's close. You really only need two columns, with each one being the ID of the members that are set as friends.
    Code:
    user_1  user_2
    45     53
    If you want to do it "properly" also look into making a primary key using both columns so that you don't get duplicate entries. You should also check for entries that are around the other way, so you don't get something like:
    Code:
    user_1 user_2
    45     53
    53     45
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    4
    Rep Power
    0
    Thanks I really appreciated this! I will defiantly use the users id instead of the username. I haven't looked to much in the proper etiquette of SQL dbs but I will check it out!

    Thanks;
    -Travier

IMN logo majestic logo threadwatch logo seochat tools logo