Forgive my ignorance, but I am quite new to PHP/MySQL.
What I would like to achieve is, for a Top 10 on my radio station, I would like to allow the people to vote for individual songs, and when they do, increase the value of the number of votes in the database.
I pass the value of the song they clicked on through the URL:http://www.vlaamseradio.tk/top10/top10stem.php?Song= It does display the song correctly on the page, saying "You voted for "Songname", but the votes value will not increase in the database. Here is the code I used:
<?php
$host="localhost";
$user="*****";
$pwd="******";
$dbname="jingleko_reloader";
mysqli_connect($host,$user,$pwd, $dbname);
$song = mysql_real_escape_string($_GET['Song']);
$songSafeHtml = htmlspecialchars($_GET['Song']);
mysqli_query("
UPDATE voting
SET Votes= Votes+ 1
WHERE Song = '$song'
");
echo ("You voted for $songSafeHtml" );
?>
Any idea where my fault could be, please?
All help will be very much appreciated.