Usage of mysqli_init() function:
<?php$con=mysqli_init();if (!$con) { die("mysqli_init failed"); }if (!mysqli_real_connect($con,"localhost","my_user","my_password","my_db") ) { die("Connect Error: " . mysqli_connect_error()); }mysqli_close($con);?>The mysqli_init() function initializes MySQLi and returns the object used by mysqli_real_connect().
mmysqli_init();
Return value: | Return an object. |
---|---|
PHP version: | 5+ |