Bug #12008 Updated: mysql_fetch_* inconsistent with MySQL C API

From: Date: Tue, 10 Jul 2001 17:08:53 +0000
Subject: Bug #12008 Updated: mysql_fetch_* inconsistent with MySQL C API
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59580@lists.php.net to get a copy of this message
ID: 12008 Updated by: brianlmoon Reported By: strougatski@ea-ratings.ru Old Status: Open Status: Closed Bug Type: Feature/Change Request Operating System: RedHat 6.2 PHP Version: 4.0.6 New Comment: In PHP setting a var to NULL in fact destroys that var so it is not currently possible to have an elelment in an array that has a NULL value. On a side note, if you read the MySQL optimization docs, you will find they reccommend you never use NULL fields. Brian. Previous Comments: ------------------------------------------------------------------------ [2001-07-10 09:14:34] zeev@php.net fetch_array, in recent versions (4.0.6 inclusive) should actrually populate NULL values in the array. Are you sure you tested it with 4.0.6? How did you arrive to the conlusion they're not there? ------------------------------------------------------------------------ [2001-07-10 09:08:13] strougatski@ea-ratings.ru The handling of NULL values in mysql_fetch_* function seems to be inconsistent with MySQL C API: in C, mysql_fetch_row() would put nil values in the row array if corresponding value in the select statement is NULL. In PHP it seems, as dicussed on mysql_fetch_array() page, the NULL values would not be stored in the array at all. This poses some problems when migrating from C to PHP. Would it be possible to introduce another function that would be consistent with MySQL C API? ------------------------------------------------------------------------ ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=12008&edit=1

« previous php.dev (#59580) next »