In a registration script, an error keeps popping up. The code is as such:
try {
$dbh = new PDO("mysql:host=$hostname;dbname=booter", $username, $password);
echo 'Connected to database<br />';
/*** INSERT data ***/
$count = $dbh->exec("INSERT INTO members(username, password, email) VALUES ('$_POST['username']', '$hashedpassword', '$_POST['email']')");
/*** close the database connection ***/
$dbh = null;
}
catch(PDOException $e)
{
echo $e->getMessage();
}
Any fixes for this (as well as any tips to help with security) would be very much appreciated.