0

I was using a linux terminal to select a bigint column from another windows sql server(by php mmsql), but the result turn to be a float number.. why..

the sql is:

SELECT cAccountId FROM tAccountMaster WHERE cUserString = 'xxxx';

it should be :

array(1) { [0]=> array(1) { ["cAccountId"]=> bigint(60254406962323528) } }

but it turn out to be :

array(1) { [0]=> array(1) { ["cAccountId"]=> float(6.0254406962324E+16) } }

Here is the database structure:

enter image description here

Adi Inbar
  • 12,097
  • 13
  • 56
  • 69
Leonardo
  • 121
  • 1
  • 2
  • 9
  • Can you show your `tAccountMaster` structure and which RDBMS are you using? – Jorge Campos Jan 06 '14 at 11:15
  • the structure has been posted. please.. – Leonardo Jan 07 '14 at 02:23
  • put it on your question not as an answer. – Jorge Campos Jan 07 '14 at 12:28
  • 1
    Are your `PHP` & OS _both_ 64 bit? If not, you may want to cast to char (which is not a bad idea for ID's application side anyway). I for one don't see a datatype for `bigint`'s @ [the manual](http://www.php.net/manual/en/mssql.constants.php) – Wrikken Jan 08 '14 at 02:30
  • thank you , the problem have been solved by using convert 'SELECT convert(string,cAccountId) FROM tAccountMaster WHERE cUserString = 'xxxx';' , just like cast. – Leonardo Jan 08 '14 at 14:11

0 Answers0