If you have the mysqli extension working then you would want to only use it, or the mysql extension not both together.
You can shorten your script to this
<?php
$mysqli = new mysqli("localhost", "root", "rincewind");
/* check connection */
if (!mysqli_connect_errno()) {
echo "you've connected to the local host. <br />";
}
printf("Client library version: %s\n<br />", mysqli_get_client_info());
printf("Host info: %s\n<br />", $mysqli->host_info);
printf("Server version: %s\n<br />", $mysqli->server_info);
printf("Server version: %d", $mysqli->server_version);
$mysqli->close();
?>
Don't forget to mark the thread as resolved.