我收到错误
警告:mysqli_query() 期望参数 2 为字符串,对象在 C:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\data\localweb\login.php 第 10 行给出错误:
在执行查询时
<?php
$con=mysqli_connect("127.0.0.1","root","","forms");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql=mysqli_query($con,"SELECT * FROM register Where username='$_POST[username]' AND password='$_POST[password]'");
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "login success";
mysqli_close($con);
?>