Solved

allow users to post on other users profile pages

Posted on 2011-03-04
2
196 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

763 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

8 Experts available now in Live!

Get 1:1 Help Now