CREATE TABLE IF NOT EXISTS `ibf_fg_transactions` ( `transaction_id` int(11) NOT NULL AUTO_INCREMENT, `sender_id` int(11) DEFAULT '0', `sender_gold` decimal(10,2) DEFAULT '0.00', `sender_ip` varchar(15) DEFAULT '0', `recipient_id` int(11) DEFAULT '0', `recipient_gold` decimal(10,2) DEFAULT '0.00', `amount` decimal(10,2) NOT NULL DEFAULT '0.00', `status` int(11) NOT NULL DEFAULT '0', `system_type` int(11) NOT NULL DEFAULT '0', `post_id` int(11) DEFAULT NULL, `comment` varchar(255) DEFAULT NULL, `is_anonymous` tinyint(1) NOT NULL DEFAULT '0', `notes` varchar(255) DEFAULT NULL, `transaction_date` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`transaction_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Problem polega na tym, że nie wiem jak zapisywać w tej tabeli kwotę transakcji. W projekcie zakładamy ujemny bilans, ale to znajduje się w innej tabeli i ona zezwala na zapis ujemnych kwot, ale jak w tabeli do transakcji to zapisywać? Chodzi np. o sytuację kiedy administrator zmienia kwotę użytkownikowi - może mu dodać lub odjąć, to mogę sprawdzać i podawać jako różnicę wynik. Co Wy na to proponujecie?