php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2409 tinyint not brought in as integer
Submitted: 1999-09-29 11:40 UTC Modified: 1999-10-01 12:27 UTC
From: mbushey at virtualintensity dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0 Beta 2 OS: Linux 2.2.5 !686
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mbushey at virtualintensity dot com
New email:
PHP Version: OS:

 

 [1999-09-29 11:40 UTC] mbushey at virtualintensity dot com
 $query="SELECT IDgrp, bit FROM " .  $mysql_tablename;
 $res2=mysql_query($query);
 while ($row=mysql_fetch_array($res2)) {   
 
 #this should work but does not
 echo $row["bit"] & $row["IDgrp"];

 #changing the var type to integer works
 $a = (int) $row["bit"];
 $b = (int) $row["IDgrp"];
 echo $a & $b;

}

PHP should bring in a MySQL TinyINT as an Integer, right?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-10-01 12:27 UTC] andrei at cvs dot php dot net
All data from MySQL comes in as strings, there is no automatic
type casting.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 11:01:32 2025 UTC