Jump to content

making a add friend and block friend system in php


sahil

Recommended Posts

I started learning PhP recently and I am trying to create a social network for practice, I have got signup login and user homepage figured out what I can't seem to think about is the logic behind adding friends and blocking people. I tried looking it up and all the answers were a little too complicated for me to understand so if someone could please help me and explain the logic behind this would be a great help. Thank you. 

Link to comment
Share on other sites

A quick description of what your social network does (or what you want it to do) would be helpful, otherwise we'll just be making broad statements that may or may not be useful, or even correct in the context of your social network. For example, a social network where people join groups and post messages to those groups would require different design to one where users choose to follow others and see everything those others post.

Also the underlying technology would be useful to know, e.g. does your PHP use a relational database, a NoSQL database, flat files, etc?

Link to comment
Share on other sites

I have the logic and everything in place but I am having trouble getting the friend request receiver's ID here  is the problem that I have described with my database structure and code, on stack overflow. There was a comment but it wasn't really helpful. I hope this link would present my question a little better.

Link to comment
Share on other sites

You probably want to add an input element to your form so that the user can can enter a username of the person they want to make the friend request with, then you'll have a username you can use to look up a user_id from your registeredusers table.

Also, while Xorifelse's comment on stack overflow could have been worded better, it is definitely worth learning about parameterized queries (better to learn good habits to start with than have to unlearn bad ones later).

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...