Like and unlike system (similar to Facebook likes) using PHP and Mysql

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2024
  • I create posts texts in the database and user can like and unlike a post without the page reloading.

ความคิดเห็น • 60

  • @thenigelproduction8512
    @thenigelproduction8512 4 ปีที่แล้ว +1

    The Most Simple Yet The Most Helpful Tutorial, Thanks!

  • @webcreator944
    @webcreator944 6 ปีที่แล้ว +5

    in the video, I can see that each time you click like/unlike button the page is refreshing. that's mean ajax not working properly.

  • @iwanwilaga
    @iwanwilaga 4 ปีที่แล้ว +1

    Thank you Bro! Perfect, simple demonstration, all i needed now. Sometimes need no words, actions are enough. : ) Best wishes from Hungary

  • @forester1
    @forester1 2 ปีที่แล้ว

    Thank you solved my biggest problem

  • @SomberResponse
    @SomberResponse 7 ปีที่แล้ว +1

    Who did you get this video from? We all seem to need his code or maybe an updated version.

  • @muhammadshoaib3005
    @muhammadshoaib3005 2 ปีที่แล้ว

    excellent, very simple thanks

  • @KimKongKun1337
    @KimKongKun1337 7 ปีที่แล้ว

    Great video. Very helpful

  • @Thepizzaman181
    @Thepizzaman181 4 ปีที่แล้ว +1

    For anyone wondering why the click does not work, you need the jquery.min.js file and then it works perfectly. Search on google for this file.

  • @jefreytv703
    @jefreytv703 5 ปีที่แล้ว +1

    where can i download the source code? the link you provided doesn't work

  • @dharmeshpanchal4864
    @dharmeshpanchal4864 6 ปีที่แล้ว +1

    Great work

  • @theschoolkid6553
    @theschoolkid6553 3 ปีที่แล้ว

    Hey There.. Thank you so much , I did it .

  • @paragchirde4138
    @paragchirde4138 7 ปีที่แล้ว

    This video is good! It would have been more interesting if there was a voice guidance.

  • @tomcruss8895
    @tomcruss8895 8 ปีที่แล้ว

    your code is working but when i click the unlike the data not delete in database its adding again. and the post table like column also doesnt change anything plz give a solution to this

  • @KimKongKun1337
    @KimKongKun1337 7 ปีที่แล้ว +1

    Can you please explain what an "int" is, and why people always set the value to 11?

    • @padcrew5647
      @padcrew5647 6 ปีที่แล้ว +6

      An "int" Is Short For An 'Integer' Which Means Nothing Else Other Than A Whole Number Is Accepted Into That Field. As For People Always Setting It To 11, That May Be Due To The Fact That It Is The Number Your Server Will Use If You Don't Specify Any Desired Value + It Is A Really Huge Number (It's Maximum Value Would Be 10 Billion To Put Things Into Perspective) So They Wouldn't Run Out In A Hurry. Hope This Helps. :)

    • @KimKongKun1337
      @KimKongKun1337 6 ปีที่แล้ว +1

      thx

    • @padcrew5647
      @padcrew5647 6 ปีที่แล้ว +1

      You're Welcome 👍

  • @jadejajaypalsinh7333
    @jadejajaypalsinh7333 6 ปีที่แล้ว

    i want to count clicks on particular post and update in database,
    how it is possible??

  • @wolfred7767
    @wolfred7767 6 ปีที่แล้ว

    is not working my like button is not adding any number and is not even showing unlike why ?

  • @LaxmanAdda
    @LaxmanAdda 7 ปีที่แล้ว

    I don't want the page to reload. If I like the 10th post, it gets reload and shows first post

    • @nissrinelaalioui5550
      @nissrinelaalioui5550 4 ปีที่แล้ว +1

      I know this is an old comment, but did u find the solution please??

  • @f_ajam001
    @f_ajam001 ปีที่แล้ว

    thank you so much. i can like but i can't click unlike. do you know why?

  • @taitmann6489
    @taitmann6489 4 ปีที่แล้ว

    cool tut...best..best

  • @BrijeshKumar-ls1yy
    @BrijeshKumar-ls1yy 5 ปีที่แล้ว

    bro if you are using jquery than why your page is getting refreshed

  • @juixyy
    @juixyy 4 ปีที่แล้ว

    how to get userid based on the post?

  • @lynnnana5633
    @lynnnana5633 6 ปีที่แล้ว

    Hell Ava, this is a great tutorial. thumbs up. I have actually implemented this on my real project and it works like charm, though I did some modification. Your website has a lot of resources as well. I just have one issue, why does the page refreshes when we are using ajax.

    • @AwaMelvine
      @AwaMelvine  6 ปีที่แล้ว +1

      Thanks for your Kind words, Lynn.
      I think the page is reloading is because by default, all browsers try to navigate to a new page whenever the element is clicked. And for this to occur, the page has to reload. So in our page, we have our 'a' tag pointing to no page ( that is "") so when the user clicks on it, it reloads that same page.
      The solution to this is to pass an event (e) in our javascript callback function that is handling the click event, then inside that function we do e.preventDefault(). This will prevent the default browser behavior for "a" links and hand over control to jQuery and jQuery will do it's job without reloading the page.
      That is a detail I missed out when I was creating the tutorial. Thanks for pointing it out.

    • @taitmann6489
      @taitmann6489 4 ปีที่แล้ว

      and also maybe because the index.php is calling itself in the ajax call.

  • @MySubash123
    @MySubash123 8 ปีที่แล้ว

    whole program run properly but when like or unlike clicked then whole page reloads..

    • @lumkojafta9070
      @lumkojafta9070 7 ปีที่แล้ว

      please send me the dummy code of creating like/unlike in php without refreshing

  • @vikasg2144
    @vikasg2144 7 ปีที่แล้ว +1

    how to get member name if someone click like

  • @jaskiratsingh3450
    @jaskiratsingh3450 7 ปีที่แล้ว

    thanks

  • @lumkojafta9070
    @lumkojafta9070 7 ปีที่แล้ว

    please send me the dummy code of creating like/unlike in php without refreshing

  • @KimKongKun1337
    @KimKongKun1337 7 ปีที่แล้ว

    The AJAX Part Ain't Working

  • @winheartsofpeople
    @winheartsofpeople 5 ปีที่แล้ว

    useful

  • @adityasinha7895
    @adityasinha7895 7 ปีที่แล้ว

    my ajax part is not working

  • @pinkurinki
    @pinkurinki 7 ปีที่แล้ว

    Nice

  • @paulomagalhaes6752
    @paulomagalhaes6752 5 ปีที่แล้ว

    muito bom ..valeu

  • @jtx8848
    @jtx8848 7 ปีที่แล้ว

    Hi your video is very helpful thank you for sharing.
    I have a problem with receiving POST data from AJAX.
    1. The POST data is verified to be sent successfully because the success:function() was executed (with a line of testing alert()):
    $.ajax({
    type: 'POST',
    url: 'index.php',
    async: false,
    data:{
    'liked': 1,
    'postid': postid
    },
    success:function(){
    alert('yay');
    }
    });
    2. My php code at the beginning of the file is:

    • @Corzhy0
      @Corzhy0 7 ปีที่แล้ว

      Jack Xu for your first problem you need to pass the data into the success function

  • @natubhaisharma9467
    @natubhaisharma9467 ปีที่แล้ว

    Amit valand

  • @nazekkhayat8187
    @nazekkhayat8187 4 ปีที่แล้ว

    IT WORKS!!!!!!!!!!!!!!
    THE DISLIKE BUTTON WORKS

  • @venkatnarahari
    @venkatnarahari 7 ปีที่แล้ว

    The ajax is not working at all.

  • @muhammadrafiq5062
    @muhammadrafiq5062 7 ปีที่แล้ว

    where is jquery code? which is attached in this example. It useless if not related files uploaded.

  • @vscreation6155
    @vscreation6155 5 ปีที่แล้ว

    jqury kaha se liye

  • @cbedits7641
    @cbedits7641 7 ปีที่แล้ว

    source link

  • @rootozkancelik
    @rootozkancelik 7 ปีที่แล้ว

    githup upload pls

  • @ExpertSuggestions
    @ExpertSuggestions 7 ปีที่แล้ว

    hy not making blog to share code i m annoying to watch whole video and type code

  • @rickgeng463
    @rickgeng463 7 ปีที่แล้ว

    please upload scripts thankssss

  • @muhammadtufail5685
    @muhammadtufail5685 8 ปีที่แล้ว

    اور

  • @natubhaisharma9467
    @natubhaisharma9467 ปีที่แล้ว

    535573