Okay newbie here so probably have something completely wrong, actually forgot to encrypt the password for starters :-[
[php]
try {
$dbh = new PDO(“mysql:host=$host;dbname=$dbname”, $dbusername, $dbpassword);
}
catch(PDOException $e)
{
$error = "Database Error ".$e->getmessage();
include($globalvar['default_template'].'header.php');
include($globalvar['default_template'].'temp_error.php');
include($globalvar['default_template'].'footer.php');
exit;
}
/* Okay let's write this bad boy away */
try {
$sql = "INSERT INTO lb_member (username, password, email, firstname, lastname, group, created) VALUES (:username, :password, :email, :firstname, :lastname, :group, :created)";
$q = $dbh->prepare($sql);
$q->execute(array(':username'=>$username,
':password'=>$password,
':email'=>$email,
':firstname'=>$firstname,
':lastname'=>$lastname,
':group'=>$group,
':created'=>$created));
$message = "Account Successfully Created";
include($globalvar['default_template'].'header.php');
include($globalvar['default_template'].'temp_message.php');
include($globalvar['default_template'].'footer.php');
exit;
}
catch(PDOException $e)
{
$error = "Database Error ".$e->getmessage();
include($globalvar['default_template'].'header.php');
include($globalvar['default_template'].'temp_error.php');
include($globalvar['default_template'].'footer.php');
exit;
}
[/php]
Not getting any errors, the db connect seems to be rocking, but doesn’t throw an error. So what am I doing wrong?