I've been looking at this tutorial for help on switching over to PDO: http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers
However, there is just one thing I cannot find.
Say I have a text input form with the name "user"
So, would the PHP code for PDO look like the following:
$name = $_POST['name'];
$stmt = $db->prepare("INSERT INTO table(name) VALUES(?)");
$stmt->execute(array($name));
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
Essentially what I'm asking is that if this is safe. I know PDO is different than mysql_* in the sense that you don't use mysql_real_escape_string anymore but is this all I need to do to ensure no malicious data will be put into the database?