PHP 7.1.3 Released

mysqli_connect

(PHP 5)

mysqli_connectAlias di mysqli::__construct()

Descrizione

Questa funzione รจ sinonimo di: mysqli::__construct()

add a note add a note

User Contributed Notes 3 notes

up
0
thamizh82 at gmail dot com
2 months ago
$con=mysqli_connect("localhost","my_user","my_password","my_db");

var_dump($con);  -> Return mysql object.

$conn = mysqli_connect(NULL, $user, $pass);
$conn = mysqli_connect('NULL', $user, $pass);
Return Same object given before. Not thrown false or error.

$conn = mysqli_connect('NULLTest', $user, $pass);
Return false
up
-32
tuxedobob
5 months ago
When using this function rather than the OO syntax, this function will return FALSE on error, rather than an object.
up
-34
d4v3m0nk
5 months ago
Worthwhile noting that the MySQLi library can still open a permanent connection, but a different command isn't used. Simply prepend "p:" to the MySQL hostname or address.

Using classes:
$this->mysqli = new mysqli('p:'. mysql_host, mysql_user, mysql_password, mysql_database);

Using command:
$link = mysqli_connect('p:mysql_host', 'mysql_user', 'mysql_password', 'mysql_database');
To Top