forked from Puneet2000/Edhub-php-server-script-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestmysql.php
More file actions
19 lines (18 loc) · 763 Bytes
/
testmysql.php
File metadata and controls
19 lines (18 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/* Using "mysqli" instead of "mysql" that is obsolete.
* Change the value of parameter 3 if you have set a password on the root userid
* Add port number 3307 in parameter number 5 to use MariaDB instead of MySQL
*
* Utilisation de "mysqli" à la place de "mysql" qui est obsolète.
* Changer la valeur du 3e paramètre si vous avez mis un mot de passe à root
* Ajouter le port 3307 en paramètre 5 si vous voulez utiliser MariaDB
*/
$mysqli = new mysqli('127.0.0.1', 'root', '', '');
if ($mysqli->connect_error) {
die('Connect Error (' . $mysqli->connect_errno . ') '
. $mysqli->connect_error);
}
echo '<p>Connection OK '. $mysqli->host_info.'</p>';
echo '<p>Server '.$mysqli->server_info.'</p>';
$mysqli->close();
?>