Answers for "In PHP in order to access MySQL database you will use: * 2 points mysqliconnect() function mysqli-connect() function mysqli_connect() function sql_connect() function"

PHP
1

mysqli connect

<?php
$mysqli = new mysqli("localhost","my_user","my_password","my_db");

// Check connection
if ($mysqli -> connect_errno) {

  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  
  exit();

  }
?>
Posted by: Guest on November-12-2020

Code answers related to "In PHP in order to access MySQL database you will use: * 2 points mysqliconnect() function mysqli-connect() function mysqli_connect() function sql_connect() function"

Browse Popular Code Answers by Language