HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP mysqli_init() Function

PHP MySQLi Reference PHP MySQLi Reference

Example

Use of the 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);
?> 

Definition and Usage

The mysqli_init() function initializes MySQLi and returns an object to use with the mysqli_real_connect() function.


Syntax

mmysqli_init();

Technical Details

Return Value: Returns an object
PHP Version: 5+


PHP MySQLi Reference PHP MySQLi Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE