When this code is run this error appears Parse error: syntax error, unexpected '$_POST' (T_VARIABLE), expecting '. Im not very good at code so help is appreciated thank you.
<?php $servername = "localhost";
$username = "root";
$password = "";
$dbname = "test";
$connection = new mysqli($servername, $username, $password, $dbname);
if ($connection->connect_error) {
die("Connection failed: " . $connection->connect_error);
}
$sql = "SELECT username FROM users";
$result = $connection->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
if $_POST["username"] === $row["username"] and $_POST["password"] === $row["password"]
header( 'Location: home.php' );
}
} else {
echo "header( 'Location: landing.php' ) ;";
}