Solved

allow users to post on other users profile pages

Posted on 2011-03-04
2
198 Views
Last Modified: 2012-05-11
allow users to post on other users profile pages.

ok so am learning php :)

i can register a user get him to log in and display a profile page with info about them that they can edit.

now i am moving on to allow other registered users who also have there own profiles to be able to post on there friends profiles (like face book) but i cant get my head around the database relationships to allow posts to only appear on the profile page that it was posted on.
can any one push me in a direction to what to look at that can help me understand how to do this
0
Comment
Question by:helpchrisplz
2 Comments
 
LVL 8

Accepted Solution

by:
rationalboss earned 500 total points
ID: 35035245
Since you mentioned that you can already register/authenticate users, you need to utilize this information to handle the posts.

For example, create the following table:
posts
------
postid INT PRIMARY KEY AUTO_INCREMENT NOT NULL
post_date DATETIME
post_text TEXT
post_to INT
post_by INT

post_to and post_by are user IDs of your users. This would be the primary key you used in your users table.

Whenever there is a new post, you insert the data to 'posts'
INSERT INTO posts (postid,post_date,post_text,post_to,post_by) VALUES (NULL,NOW(),'This is an example post!',1,2); // this means userID=2 posted to userID=1

Hope this made sense :)
0
 
LVL 1

Author Closing Comment

by:helpchrisplz
ID: 35125761
this is great thx i have been AFK for a bit and only getting this sorted now but thx for this help
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now