ID: 21279 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Bogus +Status: Open Bug Type: ODBC related Operating System: Windows PHP Version: 4.3.0 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [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