I'm working on a little browser game, but when I have a condition in connection to MySQLi database, it doesn't work.
In else closure it should write $name, but it doesn't.
if ($conn->connect_error){
die("Connection failed: ".$conn->connect_error);
}
else{
//IF CONNECTION IS GOOD, GET DATA FROM DATABASE
$query = "SELECT name, separator, description, maintenance FROM configuration";
$result = mysqli_query($conn, $query);
$row = mysqli_fetch_assoc($result);
$name = $row['name'];
//this ↓↓↓
echo $name;
}