What is the difference between connecting database using PDO or mysqli_connect, etc?
What are the pros and cons of each approach? Which one is the preferred approach?
Here are my examples:
First the PDO approach.
<?php
$username = 'root';
$password = '';
$connection = new PDO( 'mysql:host=localhost;dbname=pacificsky', $username, $password );
?>
and here is the mysqli_connect.
$db = mysqli_connect('localhost','root','','pacificsky');