Answers for "connect to php mysql database java"

PHP
18

mysql db connection in php

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn= mysqli_connect($servername,$username,$password,$dbname);
// Check connection
if (!$conn) {
  die("Connection failed: " . mysqli_connect_error());
}
echo "Connected Successfully.";
?>
Posted by: Guest on May-11-2020
0

how to connect to a mysql database using php

<?php
  $serverName = "localhost";
  $dBUsername = "root";
  $dBPassword = "";
  $dBName = "users";

  $conn = mysqli_connect($serverName, $dBUsername, $dBPassword, $dBName);

  if (!$conn) {
    die("Connection failed: " . mysqli_connection_error());
  }
Posted by: Guest on September-30-2021

Code answers related to "connect to php mysql database java"

Browse Popular Code Answers by Language