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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 15:01:35 2024 UTC