From:             me at kamuzon dot ru
Operating system: OS/2
PHP version:      4.3.8
PHP Bug Type:     ODBC related
Bug description:  something wrong

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.

-- 
Edit bug report at http://bugs.php.net/?id=29600&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29600&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29600&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29600&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29600&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29600&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29600&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29600&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29600&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29600&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29600&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29600&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29600&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29600&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29600&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29600&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29600&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29600&r=float

Reply via email to