ID:               36662
 Updated by:       [EMAIL PROTECTED]
 Reported By:      gustav at cst dot co dot za
-Status:           Open
+Status:           Bogus
 Bug Type:         PDO related
 Operating System: Microsoft Windows XP
 PHP Version:      5.1.2
 New Comment:

Duplicate of #36632.


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

[2006-03-09 11:44:54] gustav at cst dot co dot za

The problem seems more general than I realised. an UPDATE affecting 0
rows *also* returns FALSE instead of int(0).

This following error message is returned in both cases:
SQLExecDirect[0] at ext\pdo_odbc\odbc_driver.c:230

NOTE: A temporary workaround is to use query() instead of exec().

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

[2006-03-09 08:02:47] gustav at cst dot co dot za

Description:
------------
Hi,

I use PDO_ODBC (linked against Win32 ODBC) to connect to MSSQL.
Webserver is IIS 5.

When I run a "DELETE" statement that tries to delete a nonexisting row,
exec() returned FALSE instead of int(0).

An existing row deletes fine.


Reproduce code:
---------------
<?php
    $dsn = 'odbc:database';
    $user = 'user';
    $password = 'pass';

    $dbh = new PDO($dsn, $user, $password);

    $result = 
    $dbh->exec("DELETE FROM radio WHERE station_id = 10");

    if ($result===false)
      echo "FALSE";
    else
      $result;
?>    

Expected result:
----------------
0

Actual result:
--------------
FALSE


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


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

Reply via email to