代码运行一直提示我第23行有错误
<?php
session_start();//开始会话if (isset($_POST['userid'])&&isset($_POST['password']))
 {//使用者尝试登录
$userid=$_POST['userid'];
$password=$_POST['password'];
$db_conn=new mysqli('localhost','root','','auth'); if(mysqli_connect_errno()){
echo 'Connection to database failed:'.mysqli_connect_error();
exit();
}
$query='select * from authorised_users'
."where name='$userid'"
."and password='$password'"; $result=$db_conn->query($query);
if ($result->num_rows >0) {
$_SESSION['valid_user']=$userid;
} $db_conn->close();
}
?><html>
<body>
<h1>home page</h1>
<?php
if(isset($_SESSION['valid_user']))
{
echo 'you are logged in as'.$_SESSION['valid_user'].'<br>';
echo '<a href="logout.php">log out</a><br>';}
else
{
if (isset($userid)) 
{
echo 'Could not log you in.<br>';
}
else
{
echo 'you are not logged in';
}echo'<form method="post" action="authmain.php">';
echo'<table>';
echo'<tr><td>Userid:</td>';
echo'<td><input type="text"name="userid"></td></tr>';
echo'<tr><td>password:</td>';
echo'<td><input type="password"name="password"></td></tr>';
echo'<tr><td colspan="2" align="center">';
echo'<input type="submit"value="log in"></td></tr>';
echo'</table></form>';
}
?>
<br>
<a href="members_only.php">Members section</a>
</body>
</html>