I need help on a .php file:
<?php
// Credenziali di accesso al database
$servername = "localhost";
$username = "paperpediaforum";
$password = ""
$dbname = "my_paperpediaforum";
// Connessione al database
$conn = new mysqli($servername, $username, $password, $dbname);
// Verifica della connessione
if ($conn->connect_error) {
die("Connessione al database fallita: " . $conn->connect_error);
} else {
echo "Connessione al database riuscita!";
// Qui puoi inserire il codice per eseguire le query o altre operazioni sul database
}
?>
when i open the file it says:
Parse error: syntax error, unexpected variable “$dbname” in /membri/paperpediaforum/database.php on line 6
do you know why?
(it doesn’t close the connection on purpose, because other php files will use this and then they will close the connection)
sorry for the bad english
I tried many methods, but it never worked. before it said that it couldn’t find the database, now it says that he doesn’t expect the variable $dbname. i don’t jnow what to do.