Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:06:58+00:00 2026-06-10T20:06:58+00:00

I am making a website where you can like blog posts as well as

  • 0

I am making a website where you can like blog posts as well as user updates, so should I use insert statement for each likes of user passing post/blog id’s or should I use an array and save likes of user in a single comma separated array

Like this:

Post 1 Example SQL:

-------------------------------------------
Likes(user_id)         postid          
-------------------------------------------
user1                  post1
user2                  post1

Or Array

-------------------------------------------
postid              likes         
-------------------------------------------
post1               user1, user2, user3

Moreover how facebook shows posts on wall randomly, I mean if I store updates in a table and when I loop using those updates, I get updates in line, now How I can add photos uploaded in between or a person adding another as a friend etc etc, I mean are they showing news feeds and linking with the original posts

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:06:59+00:00Added an answer on June 10, 2026 at 8:06 pm

    Do you ever care about getting the individual likes back, unliking something, searching for likes by user, or perhaps even searching for likes by friends of a user? If so, save one record per user-post, and don’t use a comma-separated list/array. The list/array will get unmanageable very quickly and honestly, they are just not what relational databases are good at doing.

    If you need to display a comma-separated list on the screen, you can use GROUP_CONCAT to get a string for display.


    As far as the second question goes, I’m sure there’s some sort of “complicated algorithm” going on, based on what the user often clicks on, to show the user more of “what they like” from their friends. After that it’s probably just a random smattering of all kinds of “wall-item” in newer-things-first order, where “wall-item” can be of type (update, news, video, image, check-in, app-access). I additionally suspect there’s something else going on with the ordering, because the order is most definitely not posting time, nor last time touched.

    I also remember way back when some user settings where you could choose the weightings of different kinds of posts (e.g. 10x updates, 3x news, 5x video, 5x image, 1x check-in, 1x app-access) which would change the “randomness” of what comes out the other end. In this case, naively, it would be 1d25, mapped to 1-10=>updates, 11-13=>news, 14-19=>video, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a social website that each user can view his own or
I'm making a website for a designer friend, he can design stuff quite well
On a website I'm making, I would like to know how a user landed
I am making a website where a user can create an account and then
I'm making a website with specific posts that have tags created by the user.
I would like to pursue making a website widget that can allow visitors to
I'm making a micro-blogging website where users can follow tags. Like in twitter, users
I'm making a micro-blogging website. The users can follow each other. I've to make
I have the following problem. I am making this website you can see in
I am making a small section of an app (phone and website) that can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.