PHP Interview Questions
How would you connect to a MySQL database from a PHP script?
To connect to some MySQL database, the mysqli_connect() function is used. It is used in the following way :
<?php 
  $database = mysqli_connect("HOST", "USER_NAME", "PASSWORD");
   mysqli_select_db($database,"DATABASE_NAME"); 
?>