January 21st, 2012, 03:39 PM
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.
If this is the wrong section I apologize. I'm not looking for any code just trying to piece it together in my head.
January 22nd, 2012, 05:39 PM
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.
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.
January 22nd, 2012, 06:21 PM
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:
Where one row shows the relation between 2 members?
ID FriendA FriendB
23 Bob Jim
January 22nd, 2012, 06:38 PM
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.
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:
January 22nd, 2012, 06:55 PM
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!