Jump to content

Recommended Posts

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/147027-confussed-about-what-to-do/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.