Bug #15399 Updated: returning fields with appropriate type from MySQL
| From: | a at simongrant dot org | Date: | Sun, 24 Feb 2002 15:42:19 +0000 |
| Subject: | Bug #15399 Updated: returning fields with appropriate type from MySQL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-954@lists.php.net to get a copy of this message | ||
ID: 15399
Updated by: a@simongrant.org
Reported By: a@simongrant.org
-Status: Closed
+Status: Open
Bug Type: Feature/Change Request
PHP Version: 4.1.1
New Comment:
It does matter to me. The problem arose for me by my using the &
operator on the returned values. Though I might have expected it, no
automatic cast was done to an integer, with nonsense results. Instead,
any value I want to use as a bit array to do bit manipulation on I have
to cast (laboriously, error-prone) to (integer). That's a pain.
All I'm asking for is to have a fetch command that returns a sensible
type appropriate to the type stored in the database.
Previous Comments:
------------------------------------------------------------------------
[2002-02-24 07:30:49] sander@php.net
PHP has no (strict) types so it doesn't matter which types
mysql_fetch_row & co return.
------------------------------------------------------------------------
[2002-02-06 05:17:07] a@simongrant.org
As a recent starter with PHP and MySQL, I have been caught out for too
long not realising that all fields returned using mysql_fetch_row (and
presumably others) are returned as strings. It would be really useful
if there were a variant mysql call which returned the field with an
appropriate type. Is the problem that PHP doesn't have enough types?
Well, a fairly good job could be done on it anyhow.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15399&edit=1