PHP MySQL snippet

<?php $serveur = "127.0.0.1"; $login = "my_user"; $pass = "my_password"; $base = "my_db"; //$link = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db"); $link = mysqli_connect($serveur, $login, $pass, $base); if (!$link) { echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; exit; } echo "Success: A proper connection to MySQL was made! The my_db database is great." . PHP_EOL; echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL; $resultat = $link->query ("SELECT id, titre, image_s FROM ARTICLES WHERE statut > 0 ORDER BY date DESC, id DESC LIMIT 0, 1"); $ligne = $resultat->fetch_assoc(); echo 'ID :'.$ligne["id"].'Titre : '.$ligne["titre"]; mysqli_close($link); ?>