opening mysql link in php

<?php
/* Connect to a MySQL server */
$link = mysqli_connect(
             'localhost',  /* The host to connect to */
             'user',       /* The user to connect as */
             'password',   /* The password to use */
             'world');     /* The default database to query */

if (!$link) {
    printf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error());
    exit;
}