Okay, so... I'm trying to make a simple little scoreboard. And, I must say- I'm doing pretty well, since I'm a newb at MYSQL. My current issue is I'm having trouble increasing the win count. The way I am attempting to do this is "SELECT win FROM high_scores WHERE username='$usr' ", however, I likely have a few syntax errors. Alongside that, I have absolutely no idea how to turn this into a PHP variable.
I have attempted various things, and the one that I think should work (but doesn't) is :
$usr='userGuy';
$sql = "SELECT win FROM scoreboard WHERE usr = '$usr' ";
$win= mysql_query( $sql, $conn );
echo "$usr has a score of $win wins";
and if userGuy had, say, 57 wins, the outcome would be : userGuy has a score of 57 wins
This is not the case though. Long story short, I need to be able to update win... My endgoal is to make a variable called $newWin and make it $win + 1 then update the MYSQL database so that userGuy now has 58 wins.
Thanks in advance for your help guys! :D (if anything was unclear(likely) please tell me... This is my first time trying to explain a coding problem I have rofl)
EDIT: On the matter of SQL Injection, this scoreboard is simply for me an a group of friends to use, it's nothing serious. For the matter of not making things more complicated, I'm perfectly fine with 'unsafe methods' (I fully realize the dangers of using whatever code for legitimate purposes)