When I execute my, mysql query to database using PDO-mysql it will not insert the values. I am following the documentation but still don't seem to have made any progress.
So my .sql file is this
CREATE DATABASE IF NOT EXISTS `qr_db`;
CREATE TABLE IF NOT EXISTS `qr_db`.`clients` (
`id` int(11) NOT NULL auto_increment,
`first_name` varchar(100) NOT NULL,
`last_name` varchar(100) NOT NULL,
`key` char(128) NOT NULL,
PRIMARY KEY(`id`),
UNIQUE KEY `key` (`key`)
) ENGINE=MyISAM;
grant select, insert, update, delete
on qr_db.*
to qr_db@localhost identified by 'password';
and this is the code I'm having trouble with
if(!isset($_GET['key'])) {
$mysql = db_connect(); // <--- this is ok i already checked this
$query = 'INSERT INTO `clients` (`first_name`, `last_name`, `hash`) VALUES (?, ?, ?)';
$stmt = $mysql->prepare($query);
$stmt->bindParam(1, $f_name, PDO::PARAM_STR);
$stmt->bindParam(2, $l_name, PDO::PARAM_STR);
$stmt->bindParam(3, $dubhash, PDO::PARAM_STR);
$stmt->execute();
}