i am creating a social site using PHP and HTML. i want to add “ADD FRIEND” button or link on my site. I wonder how can i do that. means whenever user searches for some name, then related search get displayed sequentially.
What i want is add friend button in front of every user that listed by search.. is there any way i can do that?
so if user click on that button then user id and friend id get inserted into friend table?
Thanks in Advance.
Ok, I’ve done this, first of all set a session variable and store current logged in user id in that like this
now I am not aware what kind of database design are you using, or what because you’ve not specified or provided any code from your side but simple way you can do this is make a simple submit button encapsulate it within a form tags, and use post method