register3 file
we don't close the connection with
$conn = null;
?In our last two articles, we discuss on how to create a registration page using mysql and mysqli extension and how to secure it using mysql_real_escape_string or mysqli_real_escape_string.
This time we will modify our code to use PDO instead of mysql or mysqli extension.
Before we begin, let’s give some few advantages of using PDO in favor of mysqli.
PDO and mysqli has little to no difference at all except that PDO is more portable. So, if you want to connect to multiple databases without using different drivers, it’s preferable to use PDO.
Now, here’s the code of using PDO with little changes from our previous tutorial.
registration3.html Just change the line from previous tutorial:$conn = null;
?