MySQL The mysql functions are procedural and use manual escaping.
// mysql$mysql = mysql_connect('localhost','username','password','database');MySQLi is a replacement for the mysql functions, with object-oriented and procedural versions. It has support for prepared statements.
// mysqli, procedural way$mysqli = mysqli_connect('localhost','username','password','database');// mysqli, object oriented way$mysqli = new mysqli('localhost','username','password','database');PDO (PHP Data Objects) is a general database abstraction layer with support for MySQL among many other databases. It provides prepared statements, and significant flexibility in how data is returned.
// PDO$pdo = new PDO("mysql:host=localhost;dbname=database", 'username', 'password');
No comments:
Post a Comment