Jump to content

Like facebook news feed


adamlacombe

Recommended Posts

I was wondering what approach you would take to code a news feed like Facebook has.

 

I have a status, users,  and photo mysql tables. Would you create a new table called "feed" and have a query run everytime someone updates, inserts, etc anything in those three tables? or something else?

What would be the most efficient way to code a news feed?

 

Thanks in advanced!

Link to comment
Share on other sites

I was wondering what approach you would take to code a news feed like Facebook has.

 

I have a status, users,  and photo mysql tables. Would you create a new table called "feed" and have a query run everytime someone updates, inserts, etc anything in those three tables? or something else?

What would be the most efficient way to code a news feed?

 

Thanks in advanced!

 

I think you've answered your own question in your question lol.

 

You could use a query when a user updates a status, inserts, etc.

 

You could code the news feed in PHP but to allow auto refreshing:

You could also use some AJAX to auto refresh user pages  :P

Link to comment
Share on other sites

Well thanks you for the reply, kadeous.

 

and no you're right, tomfmason, I don't have any code..... yet :P oh and I only bumped it once btw.

 

Do you think using JOIN would work for combining the three tables? I am no good at JOINs... I looked at some tutorials but still a little confusing.

So I think JOIN would do better because I dont want to select three different tables in three different querys and then fetch them in an array. If I did that things wouldn't be organized by date, it would be organized  by what query got fetched first.. correct?

Link to comment
Share on other sites

and no you're right, tomfmason, I don't have any code..... yet :P oh and I only bumped it once btw.

You bumped twice.

 

Do you think using JOIN would work for combining the three tables? I am no good at JOINs... I looked at some tutorials but still a little confusing.  So I think JOIN would do better because I dont want to select three different tables in three different querys and then fetch them in an array. If I did that things wouldn't be organized by date, it would be organized  by what query got fetched first.. correct?

Correct, you would want to use a join.  Google some examples and give it a shot.

Link to comment
Share on other sites

I did? huh okay...

 

Hmmm I just went over it all in my head again... would I want to structure it like that you think? Or as I said before just anytime someone posts or updates content it gets inserted into a table called "feed" then I could select all of it from there.. I think thats a better idea, what do you think?

 

Sorry if I am just babbling along.. just trying to organize my thoughts, the adderall is wearing off lol

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.