ID:               21279
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Feedback
+Status:           Open
 Bug Type:         ODBC related
 Operating System: Windows
 PHP Version:      4.3.0
 New Comment:

I just tried Win32 build of PHP 4.4.0-dev taken from snaps.php.net
(php4-win32-200301062330.zip) and it is working the same. It looked
like the fix would solve the problem but it works as if the fix was not
applied. Isn't that build supposed to include the fix?


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

[2003-01-06 12:11:01] [EMAIL PROTECTED]

Try a snapshot dated sometime after this.  I believe it does what you
want/desire.  If not many complaints happen I'll leave it in... 

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

[2003-01-03 17:09:16] [EMAIL PROTECTED]

What I meant is that every SQL based PHP database API has a function to
fetch rows into an array. When it is not not *_fetch_into is
*_fetch_row.

I do not see any ambiguity in figuring if a result column has a NULL.
As a matter of fact in the current odbc_function of php_odbc.c you
have:

http://cvs.php.net/co.php/php4/ext/odbc/php_odbc.c?r=1.143.2.1

if (result->values[i].vallen == SQL_NULL_DATA) {
        Z_STRVAL_P(tmp) = empty_string;
        break;
}

Since NULL is always NULL regardless of the data type of a column, all
that needs to be done is to leave undefined (NULL) the respective
column position of the PHP array value returned by the odbc_fetch_into.

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

[2003-01-03 12:10:44] [EMAIL PROTECTED]

Which other API's are you talking about?  Oracle?  It's the only other
extension that uses fetch into really.

As for the statement, there is no way for ODBC to really tell either. 
The API itself defines this to be rather ambiguous so it becomes
difficult to deal with.  At this time the result leaves it to the PHP
user to decide if one is really an emtpy string or NULL rather than the
PHP engine.  I tend to think this is a better solution.  

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

[2002-12-29 19:47:04] [EMAIL PROTECTED]

odbc_fetch_into returns empty strings for columns with NULL values.
This makes it impossible to distinguish whether a result column value
is a real empty string or a NULL, unlike with API functions for the
same purpose but for other databases.

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


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

Reply via email to