I'm trying to log data into my database, but I keep getting the following error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'firstName' in 'field list'
I have done research and still haven't found the answer. Do I have any unseen mistakes in my code? Am I doing something wrong? I don't see why I'm getting this error, my database does have a column called firstName. Thanks.
$db = new PDO('mysql:host=localhost;dbname=bord','root','root');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "INSERT INTO users (firstName, lastName, password, email, code, active, month) VALUES (
:firstName, :lastName, :password, :email, :code, :active, :month
)";
$statement = $db->prepare($sql);
$statement->bindParam(':firstName', $firstName);
$statement->bindParam(':lastName', $lastName);
$statement->bindParam(':password', $password);
$statement->bindParam(':email', $email);
$statement->bindParam(':code', $code);
$statement->bindParam(':active', $active);
$statement->bindParam(':month', $month);
$firstName = 'Mitchell';
$lastName = "Sanders";
$password = "password";
$email = "msandy@fakemail.com";
$code = 12345;
$active = 0;
$month = date("F");
$statement->execute();