Random
2012-06-09 13:55:38 UTC
= mysql_real_escape_string ($_POST["user_input"]);
But then I read http://www.php.net/manual/en/function.mysql-real-escape-string.php :
"Use of this extension [mysql_real_escape_string] is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used."
From // http://www.php.net/manual/en/pdo.quote.php :
"Prepared statements with bound parameters are not only more portable, more convenient, immune to SQL injection, but are often much faster to execute"
PDO::prepare() is described at:
http://php.net/manual/en/pdo.prepare.php
But I don't understand the whole PDO example. Can anyone explain how to do the simple thing I was doing, maybe provide some tutorials, etc? Thanks!