lil_amy Posted February 26, 2009 Share Posted February 26, 2009 Im trying to do some work but I've became stuck on how to go about it. I think I have done part a which is: Allow a new user to sign up to the site. A new user should provide their name, birthday, interests, and a username and password. Note that for data protection reasons, do not use your real birthday when testing! This should add a record to the users table, which has been set up on the Edward server and which has the following structure: ID – an auto-incrementing numerical ID which references each user. It is the primary key of the table, and automatically increases by 1 for each user. So the first user will have ID 1, the second user, ID 2, and so on. username VARCHAR(255) – the user’ username password VARCHAR(255) – the user’s password interests VARCHAR(255) – the user’s interests birthday VARCHAR(255) - the user’s birthday in a format like “June 6 1970” If Im right with what I think I need to do I have created an index page, sign-up page(html and a php script) and a login page (html and a php script). Then Ive got to do part b but dont have a clue how to go about doing it which is the following: Write a profile page. This should display the name, interests, birthday and friends of the currently logged in user. Ideally profiles should only be visible to friends of this user, but this is not necessary for a basic pass. You will need to use the friends table to work out who are the friends of the currently logged-in user. This is also set up on Edward and has the following structure: ID – an auto-incrementing numerical ID which references each record. It is the primary key of the table, and automatically increases by 1 for each record. So the first record will have ID 1, the second record, ID 2, and so on. me – the current user friend – friends of the current user This is probably best illustrated by example. Imagine the user with username John has three friends: Amar, Jeremy, and Scott. Scott, meanwhile, has as friends Amar, Jeremy and Jamie. In other words, John has made Scott his friend, but Scott has not yet made John his friend, and therefore Scott can view John’s profile but John cannot yet view Scott’s profile (because Scott has not agreed to John becoming his friend yet). The table would look like the following: IDmefriend 1JohnAmar 2JohnJeremy 3JohnScott 4ScottAmar 5ScottJeremy 6ScottJamie Anyone able to help me please as need to do it tonight and have 2 other parts to do. Quote Link to comment https://forums.phpfreaks.com/topic/147027-confussed-about-what-to-do/ Share on other sites More sharing options...
Mchl Posted February 26, 2009 Share Posted February 26, 2009 Better use user IDs userID, friendID 1, 2 1, 3 2, 3 etc.. The primary key for this table consists of both columns. The password should be stored in hashed form. You don't need VARCAHAR(255) for that. Quote Link to comment https://forums.phpfreaks.com/topic/147027-confussed-about-what-to-do/#findComment-771865 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.