You are not logged in.
Pages: 1
hello guys,
I'm new to php I want to connect to glpi database I tried this code :
<?php
$dbServername ="localhost";
$dbUsername="root";
$dbPassword ="";
$dbName="glpi";
$conn= mysql_connect($dbServername, $dbUsername, $dbPassword, $dbName);
?>
but got this error
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\lar\serveur_php.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\lar\serveur_php.php on line 7
appreciate any help guys
Offline
You can use mysqli_connect($mysql_hostname , $mysql_username) instead of mysql_connect($mysql_hostname , $mysql_username).
mysql_* functions were removed as of PHP 7. You now have two alternatives: MySQLi and PDO.
Offline
Pages: 1