← All docs

mysqli_connect()

Opens a connection to a MySQL server.

mysqli_connect()

function mysqli_connect(?string $hostname = null, ?string $username = null, ?string $password = null, ?string $database = null, ?int $port = null, ?string $socket = null): mixed

Opens a connection to a MySQL server.

Parameters:

  • $hostname (?string), default null, optional
  • $username (?string), default null, optional
  • $password (?string), default null, optional
  • $database (?string), default null, optional
  • $port (?int), default null, optional
  • $socket (?string), default null, optional

Returns: mixed

Availability

Compiled (AOT)Magician (eval)
AvailableNot available yet

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how mysqli_connect is implemented in the compiler, see the internals page.