Thank you, I am trying my bestOriginally Posted by Quaint
I agree with you %.
drzoid has been great.
tblAcc contains the payemts made by the users. It has the ff fields:
username, password, bankbranch, payee, voucherno, date, amount.
I tried codes this way:
$result=mysql_query("SELECT SUM(amount) FROM tblAcc WHERE
username='$username' and password='$password'");
mysql_query("INSERT INTO tblAcc (username, password, amount) VALUES ('$username', '$password', -$amount)");
I want the username and the password to be true.
The script ran, but there was no deduction.
I have a page where users can check their account balance. Is it possible to display transactions along this line?
Debit would stand for the purchases (in tblOrder), while Credit would stand for Payments (in tblAcc).Code:Debit Credit Balance 10000 10000 1500 8500 1000 7500 2000 9500
Yes, the tblAcc table has a password column.
Dont get me wrong, but I seriously think you should rewrite certain parts of your code and system design. Why do you need the username and password distributed over several places? You should have centralised this kind of data in one table and only reference to it from other tables.
We had power failure the last time.
Thanks for your advice. I understand what you mean.
I would surely redo my design. Thanks.
The table tblAcc is only used by the Administrator to add members payments. I think it be nice to add fields like username and password to go along with the rest of the fields in order for each record to be uniquely identified. What do you think?
I am thinking of creating another table (e.g. tblStatus) where results from our query would be inserted and it is tblStatus that one would use to check the account balance of the member.
mysql_query("INSERT INTO tblStatus (password, amount) VALUES ('$password', -$amount)");
Any suggestion would greatly be appreciated.