Experts Round Table Network
Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:
Password:
Remember me
Forgot your password?
Register
Large Integer Column Type
Welcome,
Guest
. Please
login
or
register
.
January 09, 2009, 06:30:41 AM
11313
Posts in
1251
Topics by
508
Members
Latest Member:
pissematbox
Home
Help
Search
Login
Register
Experts Round Table Network
|
Databases
|
MySQL
|
Large Integer Column Type
« previous
next »
Pages:
[
1
]
Print
Author
Topic: Large Integer Column Type (Read 988 times)
CrYpTiC_MauleR
Site Builder
Offline
Posts: 489
Large Integer Column Type
«
on:
June 10, 2007, 01:39:43 AM »
Is there any way to store an integer where the the max unsigned value would be
340282366920938463463374607431768211456
bigint only goes as far as 18446744073709551615
right now I have the column set as varchar(39) is there any other way?
Logged
[
x
]
Fight
|
www.crypticmauler.com
"You must be
rdivilbiss
Governing Council Member
Offline
Posts: 414
Re: Large Integer Column Type
«
Reply #1 on:
June 10, 2007, 07:50:20 AM »
Before I finished reading your question I thought of suggesting varchar, which is what you are using.
Now if this value is being used with PHP and it overflows the bounds of an integer value it will be converted to a float, so you could use a double in MySQL, as you xhouldn't have rounding errors with integer values, but still I'd probably just use varchar.
Logged
Rod
CrYpTiC_MauleR
Site Builder
Offline
Posts: 489
Re: Large Integer Column Type
«
Reply #2 on:
June 10, 2007, 02:04:19 PM »
I had to end up using PHP's bcmath functions to calculate the numbers otherwise it goes out of range. Doing so keeps it from becoming a float but then stuck with large number that want in database as an integer so I can do queries that use < and > etc you check ranges and stuff. AFAIK putting it as varchar doesn't allow that and if it does I think it converts the string to an integer which would be wrong value.
Logged
[
x
]
Fight
|
www.crypticmauler.com
"You must be
rdivilbiss
Governing Council Member
Offline
Posts: 414
Re: Large Integer Column Type
«
Reply #3 on:
June 11, 2007, 02:53:01 PM »
Then double.
Logged
Rod
Pages:
[
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
ERT 1.5
-----------------------------
=> Round Table Learning Center
=> Bug reports
-----------------------------
Legacy
-----------------------------
=> The next level
=> History of ERT
-----------------------------
Community Affairs
-----------------------------
=> Introductions
=> Ballot Box
===> Closed Polls
=> Soapbox
=> Propose and Consult
===> Propose and Consult...CLOSED
-----------------------------
Bits and Bytes
-----------------------------
=> Tips, Tricks, Snippets, Tidbits And General Pearls Of Wisdom
-----------------------------
Serverside Technology
-----------------------------
=> PHP
=> ASP
-----------------------------
Webservers
-----------------------------
=> Apache
=> IIS
-----------------------------
Databases
-----------------------------
=> MySQL
=> Access
=> MS SQL Server
-----------------------------
Clientside Technology
-----------------------------
=> HTML
=> CSS
=> Javascript
=> Flash
=> WAP/WML
-----------------------------
Web Technologies
-----------------------------
=> General Web Dev
=> Web Standards
=> XML
=> Online Marketing
-----------------------------
Graphics
-----------------------------
=> Graphics Design and Animation
-----------------------------
Programming
-----------------------------
=> .NET
=> JAVA
=> MS DOS Batch Scripting
=> Mathematics
=> C & C++
=> VB
=> Delphi
=> Algorithm design
-----------------------------
Operating Systems
-----------------------------
=> Windows (General)
=> NT Based (2K, 2K-03, NT, XP, Vista)
=> Open Source (All)
-----------------------------
Hardware
-----------------------------
=> Hardware General
=> Gamers Hardware (Advanced)
-----------------------------
Networking
-----------------------------
=> Home (small)
=> Office (large)
=> Internet
-----------------------------
Security
-----------------------------
=> General Security Issues
-----------------------------
Rants/Opinions/Proposals
-----------------------------
=> Site operation
Powered by SMF 1.1 RC2
|
SMF © 2001-2005, Lewis Media
Joomla Bridge by
JoomlaHacks.com