How to Create Like & Unlike code like FB using PHP, MySQL and jQuery

7

How to Create Like & Unlike code like FB using PHP, MySQL and jQuery

In this tutorials we are going to learn How to Create Like & Unlike code using PHP, MySQL and jQuery.

Rating system is very useful for every web project. Through this system, web admin can track the visitors like and dislike. Also it will help webmaster to understand the visitors choices and make their website more interactive with the visitors.


Demo       |

We have made the simple rating or like or unlike code system using PHP, MySQL, jQuery and Ajax. This rating system take the visitors like or dislike with jQuery and Ajax.

Step 1: Create database ‘like’ table using MySQL query.

Step 2: Create database ‘products’ table using MySQL query.

Step 3: Connect Db function with db coding.

Step 4: Index.php files have Main file show products list and and like buttons:

Step 5: Create style for css.

Add jquery code and and css link for in the code.

This is the simple and easy code for like and unlike system I hope you guyz like this please share your feedback in comments. If you face any issue please fee free to comment below.


Share.

About Author

I'm Rajasekar - Web developer, Freelancer, Blogger and Owner of DeveloperDesks. From India lives in Bahrain. I love to do coding, Creating websites and trying different with code and designs. You Can Hire Me

  • http://jquery-1.8.0.min.js
    http://script.js

    you gave the src for script.js and jquery 1.8 min.js

    where to find these files? as i have’nt got these files

    • Download the files and you can see the script files there.

    • You can find in it Download files.

  • daksh

    this is nice but can you explain what is pid, uid and op here?

    • Hi,

      Pid = Its is POST Id, get the Post details of the certain post.
      UID = Its is User id, Make a particular person only once to allow the action either like or dislike

      Op = Get the Option of the post either they click “Like” Or “Unlike”

      Thanks

    • Masdi a.k.a Zacky

      pid = product id, uid = user id

  • Masdi a.k.a Zacky

    the status attribute on the product table is used for what?