Page 1 of 1

Mysql max integer value

Posted: Fri Apr 06, 2018 6:16 am
by adamlevine
Mysql max integer value

Hi!

Here is part of my code:
(it's on desktop app, button action)

dim rs as RecordSet
dim i, fim as integer

rs=app.g_db.SQLSelect("select max(id) id from zendesk")
fim=rs.field("id").IntegerValue+1
here is the "debug of fim"

fim = -14163
and, of course, this is the "select max(id) id from zendesk" result from my database…
id= 51372

… any idea what's going on here??

Re: Mysql max integer value

Posted: Fri Apr 06, 2018 6:55 am
by bogs
… any idea what's going on here??
Yes, your dimensioning 3 variables in a basic dialect (looks like RB/Xojo), and pulling one column. Perhaps you posted on the wrong forum?

Re: Mysql max integer value

Posted: Fri Apr 06, 2018 8:10 am
by SparkOut
Whatever language, 65535-14163=51372

The correct value of the 16bit integer is being retrieved, there is just a problem with interpreting it as a signed or unsigned value.