₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,346,106 members, 8,521,131 topics. Date: Wednesday, 18 November 2026 at 10:43 PM

Toggle theme

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

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

1 Reply (Go Down)

Developing Social Networking Website Using PHP And MYSQL by macwilcy1(op):
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.
Re: Developing Social Networking Website Using PHP And MYSQL by macwilcy1(op): 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.
Re: Developing Social Networking Website Using PHP And MYSQL by macwilcy1(op): 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

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

All Programmer Help • Certifications At W3schools. • Help With This Script...