ID:               26799
 Updated by:       [EMAIL PROTECTED]
 Reported By:      danielc at analysisandsolutions dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         MSSQL related
 Operating System: Windows 2000
 PHP Version:      4.3.4
 New Comment:

Try this script:

<?php 
error_reporting(E_ALL);
$c = mssql_connect('localhost', 'sa', 'pw');
$result = mssql_query('SELECT 0/0 AS FOO', $c);
echo mssql_get_last_message();
?>

See also:
http://www.php.net/manual/en/function.mssql-min-error-severity.php

I think this is not really bug as is..the query doesn't actually
'fail'..



Previous Comments:
------------------------------------------------------------------------

[2004-01-05 16:52:37] danielc at analysisandsolutions dot com

Exactly.  That's why MSSQL considers it an error.  But PHP doesn't
report back the error from MSSQL.

------------------------------------------------------------------------

[2004-01-05 16:45:24] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Nonumber may be divided by zero.

------------------------------------------------------------------------

[2004-01-05 16:31:25] danielc at analysisandsolutions dot com

Description:
------------
MSSQL seems to not like queries that divide by zero -- see the OSQL
commands below.  But, PHP doesn't report it as an error.

   osql -Usa
   1> SELECT 0/0 AS FOO
   2> go
   Msg 8134, Level 16, State 1, Server BASE2K, Line 1
   Divide by zero error encountered.


Reproduce code:
---------------
$c = mssql_connect('localhost', 'sa', 'pw');
$result = @mssql_query('SELECT 0/0 AS FOO', $c);
if ($result) {
    $ar = mssql_fetch_array($result, MSSQL_ASSOC);
    var_dump($ar);
} else {
    echo mssql_get_last_message();
}


Expected result:
----------------
Divide by zero error encountered.

Actual result:
--------------
array(1) {
  ["foo"]=>
  NULL
}


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26799&edit=1

Reply via email to