How do I identify why is it not inserting anything?
If the db name or fields were incorrect, it would stop and through an error. It isn't.
Code: Select all
$today = (date('Y-m-d'));
// random code to be added to email for clarification
$random = (rand()%99999999);
$query = $pdo->query("INSERT INTO admin (firstname, lastname, email, created, password, address1, address2, town, county, postcode, `type`, telephone, drivinglicense, shift, status) VALUES (:firstname, :lastname, :email, :today, :password, :address1, :address2, :town, :county, :postcode, :user, :telephone, :drivinglicense, :shift, :random)");
$result = $pdo->prepare($query);
$result->execute(array(':firstname' => $firstname, ':lastname' => $lastname, ':email' => $email, ':today' => $today, ':password' => $password, ':address1' => $address1, ':address2' => $address2, ':town' => $town, ':county' => $county, ':postcode' => $postcode, ':user' => $user, ':telephone' => $telephone, ':drivinglicense' => $drivinglicense, ':shift' => $shift, ':random' => $random));