php - How can I let my visitors compare (and rate) two images displayed from a mysql database? -
so have set mysql database holds image (more path image) , images rank (starting @ 0). created web page displays 2 images @ random @ time. [up till here works fine] want users able click on 1 of images better , images rank increase +1 in database.
how set up? please detailed possible in explanation. new php , mysql.
you need this.
a table
images: id,name,path,ranking
- have 1 vote button ( update images set ranking = ranking + 1 id = $id; )
- have 1 down vote button ( update images set ranking = ranking - 1 id = $id , ranking > 0; )
hopefully solves problem.
Comments
Post a Comment