Jump to content

Money values


Darkness

Recommended Posts

Hello,Here I am again... Already. Anyways, lately, I have been having issues with Money and the sort. How should I do this? (Like, Money on an RPG, so you can buy Items). Some say I should store it in an SQL... The issue is: The money value has to be atleast 999,999,999. However, when I try to create a Longblob or Longtext (or any blobs or text fields), it won't work. Well, if you try to in a script, which I what I need to do, for certain reasons. Doubt it would even work if I created it from the database.Anyways, others have suggested using fopen. How could that be possible?Sorry if it's not quite clear.Thanks.

Link to comment
Share on other sites

You're working with a number, you don't need a long blob. A long blob stores several megabytes of binary data, you don't need several megabytes of binary data to store a 9-digit number. Use an integer column if you only need whole numbers, if you need decimals then use a float. The database does not store commas so leave those out when you work with the number, use PHP to add the commas when you write the number on the page.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...