Here I am trying to insert into db without sql injection. Things are ok as per me still not getting inserted into table:
$email = $_POST['email'];
$uname = $_POST['name'];
$myid = $_POST['myid'];
$user='root';
$pass='root';
$dbh = new PDO('mysql:dbname=test;host=127.0.0.1:3306', $user, $pass);
$stmt = $dbh->prepare('INSERT INTO user_record (id,uname,email) VALUES (:id, :uname, :email)');
$stmt->bindParam(':uname', $uname);
$stmt->bindParam(':id', $myid);
$stmt->bindParam(':email', $email);
$stmt->execute();
Can someone point what's wrong.