Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

allow users to post on other users profile pages

Posted on 2011-03-04
2
Medium Priority
?
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
rationalboss earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

718 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