Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,148,041 members, 7,799,525 topics. Date: Tuesday, 16 April 2024 at 11:53 PM

Developing Social Networking Website Using PHP And MYSQL - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Developing Social Networking Website Using PHP And MYSQL (781 Views)

Android Quiz Application With Json Parser, Php And Mysql Database / How To Make a DESKTOP Executable Software Using PHP,MYSQL,SQLITE / How To Generate A Word File .doc/.docx Using Php (2) (3) (4)

(1) (Reply) (Go Down)

Developing Social Networking Website Using PHP And MYSQL by macwilcy1: 1:50am On Apr 19, 2013
Hi, I have been working on a social networking website http://www.friendsinteract.com am have challenges and I very much welcome any help. Thank you.

The challenge am having is that when a user logs in, his or her own post is fetched first before other of his or her friends post is fetched. Inside the database, there is a column that contain the a user's friends username separated by comma (,) for instance - macwilcy,cy,cyril,cy1,macwilcy1,... I want to use the username to fetch post made by users ordering it by date. I initially used "SELECT * FROM table_name WHERE username = '$username' ORDER BY DATE" but it was fetching the posts starting from the first username to the last username regardless of which user's post is the latest post. I will very much appreciate your help. Thanks
Re: Developing Social Networking Website Using PHP And MYSQL by spikesC(m): 2:52am On Apr 19, 2013
I replied this on ya old thread...meanwhile, you're doing something really wrong.

there is a column that contain the a user's friends username separated by comma (,) for instance - macwilcy,cy,cyril,cy1,macwilcy1,...

This is very very very wrong. Research on how to design a relationship/friendship database.
I have something for you but i want you to research it yourself first. This will help you in your future quests.

2 Likes

Re: Developing Social Networking Website Using PHP And MYSQL by macwilcy1: 4:33pm On Apr 19, 2013
spikes C: I replied this on ya old thread...meanwhile, you're doing something really wrong.
This is very very very wrong. Research on how to design a relationship/friendship database.
I have something for you but i want you to research it yourself first. This will help you in your future quests.


Thanks
In my research I saw this:

Table User
--------------
UserID EmailAddress Password Gender DOB Location
------------------------------------------------------
1 bob@bob.com bobbie M 1/1/2009 New York City
2 jon@jon.com jonathan M 2/2/2008 Los Angeles
3 joe@joe.com joseph M 1/2/2007 Pittsburgh

Table Friends
---------------
UserID FriendID
----------------
1 2
1 3
2 3

Is it ok? I would appreciate to know your idea. Your idea is really important to me. Thanks for your help
Re: Developing Social Networking Website Using PHP And MYSQL by spikesC(m): 5:37pm On Apr 19, 2013
Gbam, it is so correct! cheesy
I'll send you some SQL queries for a few things you might wanna do with that table.

Remember, you can deduce a lotta things with that table structure. example, the first column is the person that sent the friend request.
Remember to add you status column. e.g pending,accepted,banned etc.

1 Like

Re: Developing Social Networking Website Using PHP And MYSQL by macwilcy1: 1:10pm On Apr 20, 2013
spikes C: Gbam, it is so correct! cheesy
I'll send you some SQL queries for a few things you might wanna do with that table.

Remember, you can deduce a lotta things with that table structure. example, the first column is the person that sent the friend request.
Remember to add you status column. e.g pending,accepted,banned etc.


Thanks very much

(1) (Reply)

Programming / Cakephp Hosting / Reason Why Africa Is Still Underdevelope And Solution To It

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.