php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29600 something wrong
Submitted: 2004-08-10 15:31 UTC Modified: 2004-08-28 20:31 UTC
From: me at kamuzon dot ru Assigned:
Status: Not a bug Package: *Directory Services problems
PHP Version: 4.3.8 OS: OS/2
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: me at kamuzon dot ru
New email:
PHP Version: OS:

 

 [2004-08-10 15:31 UTC] me at kamuzon dot ru
Description:
------------
values, which I got from db via odbc <> values, which I make by $a=blablablaNumber;

Reproduce code:
---------------
function getid($table,$field,$value){   global $dbcon;
  $sql="select id from $table where $field='$value'";
  if($result=odbc_exec($dbcon,$sql)){
    if (odbc_fetch_into($result,$ware)) {
      if($ware[0]){
        odbc_free_result($result);
        return $ware[0];
      } else {
        odbc_free_result($result);
        return false;
      }
    }
  }
}
$cid=getid('yaol_currencies','currencynick','usd'); //via odbc from db2 it gets id (smallint) from table yaol_currencies
echo $cid; //return -32766
$a=-32766;
$b[$cid]='ddd';
if ($b[$a]=='ddd') {echo 'gut';}


Expected result:
----------------
string 'gut' not posted on output

but if I add line
$cid+=0;
then string 'gut' will posted on output

Actual result:
--------------
I think $b[$a] must be equalent $b[$cid] because $a=-32766 and $cid=-32766 but the last came from odbc.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-28 20:32 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Try var_dump() on the variables and you'll see why it doesn't work.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC