如何在php中使用sqlsrv获取数据

时间:2016-11-07 12:10:26

标签: php sqlsrv

我正在尝试使用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';
    }
}   

>

0 个答案:

没有答案