From:             Jared dot Williams1 at ntlworld dot com
Operating system: Windows 2000/IIS 
PHP version:      5CVS-2004-08-10 (dev)
PHP Bug Type:     SQLite related
Bug description:  sqlite_query() return resource handles for non-row returning sql

Description:
------------
It appears sqlite_query() and sqlite_unbuffered_query() differ from the
documentation

>From http://uk.php.net/manual/en/function.sqlite-query.php
<quote>
For queries that return rows, this function will return a result handle
which can then be used with functions such as sqlite_fetch_array() and
sqlite_seek(). 

For other kinds of queries, this function will return a boolean result;
TRUE for success or FALSE for failure. 
</quote>

Seems a handle is returned irrespective of the type of query.



Reproduce code:
---------------
<?php
        $cnn = sqlite_open('Northwind.db');
        if (is_resource($cnn))
        {
                var_dump(sqlite_unbuffered_query($cnn, 'DELETE FROM Categories WHERE
CategoryID > 100000')); 
                @sqlite_close($cnn);
        }
?>

Expected result:
----------------
bool(true) 

Actual result:
--------------
resource(2) of type (sqlite result)

-- 
Edit bug report at http://bugs.php.net/?id=29601&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29601&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29601&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29601&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29601&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29601&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29601&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29601&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29601&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29601&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29601&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29601&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29601&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29601&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29601&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29601&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29601&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29601&r=float

Reply via email to