I try to connect my php script with my localhost server.
I asked classmates, but they don't know where the problem can be either.
This is the error code:
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\wamp64\www\serveranbindung.php on line 8
( ! ) Error: Call to undefined function mysql_connect() in C:\wamp64\www\serveranbindung.php on line 8
My script is this one
<?php
$servername="localhost";
$username="root";
$password="";
$db="test";
$conn=mysqli_connect($servername, $username, $password, $db);
if ($conn) {
echo "Connection success";
}else {
echo "Connection not success";
}
?>
Do you have an idea where the mistake could be?