SQLSTATE: 42000 code: 102 message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near ','.
My code , i use PHP to connect sqlsrv:
if(isset($_POST['smlogin']))
{
$namef = $_POST['fulname'];
$user = $_POST['emailz'];
$pass = $_POST['pswz'];
$md5pass = md5($pass);
$chondl = "select * from Accounts WHERE email={$user} , MD5Password={$pass}";
$nhap = sqlsrv_query($conn, $chondl);
if($nhap)
{
echo'<script>alert("Done!"); </script>';
}
else
if( ($errors = sqlsrv_errors() ) != null) {
foreach( $errors as $error ) {
echo "SQLSTATE: ".$error[ 'SQLSTATE']."<br />";
echo "code: ".$error[ 'code']."<br />";
echo "message: ".$error[ 'message']."<br />";
}
}
}
Please, help :)
You need to replace following thing in your query
After Replacement