Do not worry if you are not a pro in these languages because neither am I one. We will use some very basic concepts for doing this.
Download the Script
Below is a summary of the script, what we have done and how you can very easily accomplish it on your platform.
Follow_user Table : Storing user ids
Adding data to Database
You can either add data yourself into the users table, we will advice you to add 3 rows to the table with uid as 1,2,3 and names and image. Or else you can just copy the query in data.sql(enclosed in the zip folder of script) into your MySql query browser.
In db.php you must change the SERVER_NAME, USERNAME, PASSWORD and DATABASE to your own MySql settings.
In the above line of coding initially we have called the list of user from the database, and then we have checked into the follow_user table , to check whether the current user already follows the respective users or not, and as per that the Follow or Following buttons are displayed.
We have give the basic CSS styling to the interface in the script, while you can change it as per your requirements.
// follow class
Rest the add_follow_user.php and remove_follow_user.php are just used to collect data from the POST, and INSERT into the sql table using mysql queries.
If you face any kind of problem in implementing this tutorial, do share your problem in comments, and I will try my best to help you out. We love to help you.