Yes, the PDO.
<?php
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
?>
http://php.net/manual/en/book.pdo.php
But this error happens when php version and mysql libraries are different.
Either you update PHP and recompile it or mysql.
You can try installing/updating php5-mysqlnd.
Just for the record, this is a Warning. Your application will not fail to work.
PHP is warning that the native php and dp mysql libraries are in different versions.
Important note is that mysql_connect is deprecated. Today, by PHP guidance, one should use either the PDO or the mysqli_connect
First, the problem is not in the "command" but in the installation of different versions of ebiblioteca in the system. I think the natural way is to use mysqli_, which is made for Mysql. Now, if using other DB architectures, PDO is an alternative to consider, as answered. If you don’t want to use another base, mysqli_ makes more sense.
– Bacco