Wow, I have no clue what I'm doing.. I'm trying to make a random game and if you roll a 6, you will win 500 rp and I'm trying to insert the 500 rp into the user who is logged in ($_SESSION['username'). But I... just don't know where to begin.
Here is my crappy coding that I just.. am stumped on:
<p><?php
$dice = rand(1,6);
if($dice == 1){
echo "You rolled a
<br><b>1</b>";
}if($dice == 2){
echo "You rolled a
<br><b>2</b>";
}if($dice == 3){
echo "You rolled a
<br><b>3</b>";
}if($dice == 4){
echo "You rolled a
<br><b>4</b>";
}if($dice == 5){
echo "You rolled a
<br><b>5</b>";
}if($dice == 6){
echo "You rolled a
<br><b>6</b>";
}
$winner = "500";
if($dice == 6);
{
include("haha.php");
$cxn = mysqli_connect($dbhost,$dbuser,$dbpassword,$dbdatabase);
$sql = "INSERT INTO Member (rp) VALUES ('$winner')";
mysqli_query($cxn,$sql);
}
?>