-1
我收到這些錯誤:mysqli_query和mysqli_fetch_array期望參數
1- mysqli_query()期望至少2個參數,1 C中給出:\瓦帕\ WWW \的index.php上線13 2-警告:mysqli_fetch_array()期望參數1爲mysqli_result,null在第14行> C:\ wamp \ www \ index.php中給出。
我正在使用wamp服務器。當我使用mysql命令它對我說使用 mysqli和我沒有經驗與mysqli。
這裏是我的兩行
<?php
session_start();
include_once 'dbconnect.php';
if(isset($_SESSION['user'])!="")
{
header("Location: home.php");
}
if(isset($_POST['btn-login']))
{
$email = mysqli_real_escape_string($con, $_POST['email']);
$upass = mysqli_real_escape_string($con, $_POST['pass']);
$res=mysqli_query("SELECT * FROM users WHERE email='$email'");
$row=mysqli_fetch_array($res);
if($row['password']==md5($upass))
{
$_SESSION['user'] = $row['user_id'];
header("Location: home.php");
}
else
{
?>
<script>alert('wrong details');</script>
<?php
}
}
?>
請幫我