我正在尝试使用php中的sqlsrv从数据库中获取数据。但它显示我0计数。附上我的代码。
//check if form is submitted
if (isset($_POST['login']))
{
$email = ($_REQUEST['email']);
$password = ( $_REQUEST['password']);
$result = "SELECT * FROM Users WHERE email = '" . $email. "' and password = '" . md5($password) . "'";
$query = sqlsrv_query($conn, $result, array(), array( "Scrollable" => 'static' ));
$row_count = sqlsrv_num_rows($query);
echo $row_count;
while($row = sqlsrv_fetch_array($query))
{
echo 'yes';
}
}
>