We are in the process of making a in school version of Facebook aka Tigerbook now. We have created the following three data tables.
Users:
user name
1 Hallie
2 Dylan
3 Sarina
4 Dominic
Friends:
user friend
1 2
1 3
1 4
2 1
3 1
4 1
2 4
4 2
3 2
2 3
Posts:
user postid post
1 101 This is TigerBook!
2 102 I am pregnant.
1 103 I like peeps
4 104 Giant Buzz Lightyears rock.
3 105 Die Tucker die
1 106 Murhur de derpity derp
2 107 banana spaghetti squid
4 108 chicken
We just used the syntax of:
select user from users union select user from friends union select user from posts;
And it came up with this:
user
1
2
1
4
All we were wondering was if the join worked or if we should try something else. We've already tried left joins and full joins, but nothing has worked very well.
And on a side note: when we connect the php code to the web page will it automatically generate users when they create a login or do we already have to create the users before they make the login?