Scroll page back to the top

Thumbs up and down rating system with jQuery, PHP and MySQL

Thumbs up and down rating system with jQuery, PHP and MySQL

In this series we take a look at how to create a rating system with thumbs up and down. The ratings will be saved to the MySQL database using PHP PDO class.

PHP / MySQL Tutorial

Sebastian Sulinski on 19th Mar 2012

Download Exercise FilesDemo
 

01 : Preparation

01 : Database import (02:00 min)

1  
 

02 : Rate class

01 : Properties and Constructor (03:51 min)

2  
 

02 : Connect method (02:43 min)

3  
 

03 : Get posts (01:57 min)

4  
 

04 : Display records (03:37 min)

5  
 

05 : Get single post (02:49 min)

6  
 

06 : Add rating (03:51 min)

7  
 

07 : Update rating (02:32 min)

8  
 

08 : Reset method (04:40 min)

9  
 

09 : Remove rating method (01:24 min)

10  
 

10 : Button set method (05:07 min)

11  
 

03 : Rate javascript object

01 : Rate object (05:06 min)

12  
 

02 : Reset method (01:12 min)

13  
 

03 : Cache problem (01:10 min)

14  
 

04 : Processing requests

01 : Rate request (03:47 min)

15  
 

02 : Reset request (03:21 min)

16  
 
 
 
 

Discussion (10 comments)

  • fekri

    fekri on Tuesday, 20th March 2012

    It's a good tutorial, but it doesn't worked with me. I have my page with comments and rating icons, but when I click nothing happens.
    Thank you

    Reply

  • Sebastian Sulinski

    Sebastian Sulinski : @designtutorials on Wednesday, 21st March 2012

    Hi Fekri,
    Can you use Firefox and Firebug to see what might be causing the problem on click?

    It definitely works, so I'm assuming you must've missed or misspelled something - it happens to me all the time :)

    Reply

  • mabod

    mabod on Tuesday, 17th April 2012

    I have the same problem, it's like the functions are not working or I don't know, everything show up but I can't do any action (Reset and vote buttons don't work)

    Reply

  • Sebastian Sulinski

    Sebastian Sulinski : @designtutorials on Tuesday, 17th April 2012

    Have you completed the whole tutorial?

    Reply

  • mabod

    mabod on Tuesday, 17th April 2012

    Should the files in the "finished" folder that we can download work just like that ? If yes, it is not for me. Your codes are so clean, it would be really nice to have it to learn as much as I can

    Reply

  • Sebastian Sulinski

    Sebastian Sulinski : @designtutorials on Tuesday, 17th April 2012

    Do you have it hosted on the remote server so that I can have a look at it?

    Reply

  • Andres

    Andres : @trustdj1 on Monday, 26th March 2012

    Hi Sebastian, again great tutorial. Obviously that one has to have a good knowledge of OOP and jQuery as well, but again really good tutorials on your website.
    Greetings, Andres.

    Reply

  • Andy

    Andy on Friday, 30th March 2012

    Awesome dude :D

    Reply

  • Christos

    Christos : @seogr on Tuesday, 10th April 2012

    Hi Sebastian,

    Great tutorial as always. Many thanks and greetings from Greece :)

    Reply

  • Sebastian Sulinski

    Sebastian Sulinski : @designtutorials on Tuesday, 10th April 2012

    Hi Christos,
    Thanks!

    Reply

  • mabod

    mabod on Tuesday, 17th April 2012

    It work perfectly when I upload it on my server, but on localhost it doesn't. Just tested it to show you :p didn't even put in on my serv before.

    I don't know why it does not work on localhost, the connection with the db is fine.

    Reply

  • Sebastian Sulinski

    Sebastian Sulinski : @designtutorials on Tuesday, 17th April 2012

    I'm not sure why it doesn't work in your local environment. It did work ok on my localhost.

    Reply

  • airoschou

    airoschou on Wednesday, 18th April 2012

    Thanks for sharing!

    Reply

  • mabod

    mabod on Thursday, 19th April 2012

    I found the problem I had running it on localhost, just removed all the first / in the code pointing to files. And I add a ../ before the direction of the sprite img in the .css. Thanks for this tutorial !

    Reply

  • Cal

    Cal : @hanlincal on Tuesday, 24th April 2012

    Hey Sebastian,

    Thanks for the awesome tutorial! I'll update you once this is implemented on my site :)

    Reply

  • Cal

    Cal : @hanlincal on Tuesday, 24th April 2012

    Hey Sebastian,
    I'm trying to echo an image link instead of texts and i keep getting syntax errors like

    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, 
    expecting T_STRING or T_VARIABLE or T_NUM_STRING
    

    Reply

  • Sebastian Sulinski

    Sebastian Sulinski : @designtutorials on Wednesday, 25th April 2012

    Hi Cal,
    Can you send me your index.php file by email?
    I've already sent you an email so you can just reply to it with the attachment.

    Reply

  • Jay

    Jay on Monday, 30th April 2012

    Hi,

    I stumbled across your website and I am extremely grateful for your tutorials. I would like to be able to use this on a WordPress platform. Any suggestions on how I can do that since the database is already created. Would I just need to create the rating table? I would like to use it to rate each post.
    Thanks!

    Reply

  • Sebastian Sulinski

    Sebastian Sulinski : @designtutorials on Monday, 30th April 2012

    Hi Jay,
    It should be actually pretty easy to use it with Wordpress. You just have to link the id of the post with the rating - same way as you would with comments in the original exercise.

    Reply

  • Jay

    Jay on Monday, 30th April 2012

    Sebastian,

    Thanks very much for the tip. I will give it a try and post the results here, so others may see it. That's of course if I figure it out. :)

    Reply

 
Page 1 of 5
 
 
Add a comment
Add Comment