I'm making a php quiz and in the beginning I ask someone's name. This is stored in a session. I put the score they get in the variable $score. At the end, I need to put the name(in the session) and the score they got in a database for the highscore list. But it just won't work.
Here's my code:
$sql = mysqli_query($db, "INSERT into WP12_highscore(name, score)
VALUES (" . $_SESSION['name'] . ", $score)");
I can't find much about it, but this seems fine to me. It does work when I just put some name and number in, and the $score one works as well(have been experimenting with it so it might be wrong now), but I just can't get the session variable to store in the database..