+ 1
How do I open a connection to a mysql database using php?
3 ответов
+ 13
<?php
$username = "your_name";
$password = "your_password";
$hostname = "localhost";
//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
?>
+ 4
$conn = mysqli_connect("host","username",
"password","databaseName")