-1

For some reason i am stuck on something that has been simple for me for the past year. Inserting data into databases. Today, i have been trying to fix what is wrong with this and i can not seem to understand why stmt->execute() is returning false?! I get no errors, even when i turn on PHP, and MySQLI errors. Here is my code :

else
{
    // We are all good, lets enter this person into our DB
    $CheckUser->close();
    if ($insert_stmt = $mysqli->prepare("INSERT INTO users (name, email, country, region, city, address, password, salt) VALUES (?, ?, ?, ?, ?, ?, ?, ?)")) {    
       $insert_stmt->bind_param('ssssssss', $name, $email, $geoplugin->countryName, $geoplugin->regoin, $geoplugin->city, $address, $password, $random_salt); 
       if($insert_stmt->execute())
       {
            // Success, redirect the user to his page (Remember to login the user)
            header("Location: dashboard.php");
       }
       else
       {
            // Something happened
            echo "Something Happened";
       }
    }
}

On my page, `Something Happened" is being echoed. However, if i turn on MYSQLI Errors, then i just get a blank page after i submit. What am i doing wrong???

Hunter Mitchell
  • 7,063
  • 18
  • 69
  • 116

1 Answers1

0

As per OP's request to give an answer from my comment.

You might have made a typo in $geoplugin->regoin and meant to use $geoplugin->region?

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141