Connection to MySQL through PHP with DAO
I will try to explain to you a how DAO is a better approach to connect to MySQL through PHP, making the code readable and secure at the same time. Change our connection from mysql_connect() to new mysqli(): Imagine we have a connection.php file. Typically it looks like this:
1 2 |
$con = mysql_connect('localhost', 'myuser', 'mypass'); mysql_select_db('mydatabase_name', $con); |
Instead of this we could change it into […]
Recent Comments