|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-28 20:32 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 03:00:01 2025 UTC |
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.