I currently have this type of PDO statement to INSERT variables into the array below. I was told using PDO statements would be the most secure way of doing an insert in PHP.
$qry = $db->prepare('INSERT INTO twocents (path, name, message) VALUES (?, ?, ?)');
$qry->execute(array($path, $name, $message));
Now, would setting $path
, $name
, and $message
to the POST values from a posted form still be as secure? I'm not sure how else you would do an INSERT if those variables weren't being set by anything.
Thanks!