removed redundant count() as per review comment

This commit is contained in:
lilgreenbird 2017-07-24 15:12:03 -07:00
parent 3e8b44546f
commit e3fd38c873
3 changed files with 3 additions and 3 deletions

View file

@ -36,7 +36,7 @@ function ConnectionTest()
Trace("\nValid connection attempt (to $server) ....\n");
$conn2 = Connect();
$errors = sqlsrv_errors(SQLSRV_ERR_ERRORS);
if (!empty($errors) && count($errors) != 0)
if (!empty($errors))
{
die("No errors were expected on valid connection attempts.");
}

View file

@ -14,7 +14,7 @@ using an already closed connection.
$conn2 = Connect();
$stmt1 = sqlsrv_query($conn2, "IF OBJECT_ID('PHPTable', 'U') IS NOT NULL DROP TABLE [PHPTable]");
$errors = sqlsrv_errors();
if (!empty($errors) && count($errors) != 0)
if (!empty($errors))
{
die("No errors were expected on valid connection attempts.");
}

View file

@ -72,7 +72,7 @@ function FetchField($stmt, $idx, $numFields, $errorExpected)
function PrintError($errorExpected = true)
{
$errors = sqlsrv_errors(SQLSRV_ERR_ALL);
if (!empty($errors) && count($errors) > 0)
if (!empty($errors))
{
$e = $errors[0];
var_dump($e['message']);