这是我的第一个php页面,我无法找到错误。
请帮帮我。
错误:
PHP Parse错误:语法错误,意外的'echo'(T_ECHO)in 第17行的/var/www/html/login.php
代码:
<?php
$servername = "localhost";
$username = "sao";
$passwort = "12345";
$dbName = "sao";
$user_username = $_POST["usernamePost"];
$user_password = $_POST["passwordPost"];
$conn = new mysqli($servername, $username, $passwort, $dbName);
if(!$conn){
die("Connection Failed. ". mysqli_connect_error());
}
$sql = "SELECT password FROM users WHERE username = '".$user_username."' ";
$result = mysqli_query($conn ,$sql);
if(mysqli_num_rows($result) > 0){
while($row = mysqli_fetch_assoc($result)){
if($row['password'] == $user_password{
echo "login erfolgreich";
}else{
echo "password falsch";
}
}
}else{
echo "user nicht gefunden";
}
?>
感谢您帮助我。
抱歉我的英文不好!