Jump to content

MySQL account table

- - - - -

  • Please log in to reply
2 replies to this topic

#1
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
hi guys

i want create a table for account payment with BALANCE('POSITIVE','NEGATIVE')


this is my sample:
CREATE TABLE IF NOT EXISTS `payment` (

  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,

  `PARENT` int(11) unsigned NOT NULL DEFAULT '0',

  `AMOUNT` int(11) unsigned NOT NULL DEFAULT '0',

  `BALANCE` enum('POSITIVE','NEGATIVE') NOT NULL DEFAULT 'NEGATIVE',

  PRIMARY KEY (`ID`)

) ENGINE=MyISAM;

please help for better table

thank you

---------- Post added at 09:57 PM ---------- Previous post was at 09:54 PM ----------

i dont need duble amount

i need a table for support (-) and (+)
for ex:
-15000
and
15000

#2
lol33d

lol33d

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
hello

#3
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
wouldn't it be easier to just create an signed int amount, and check if its less than 0 to be negative?
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users