Thank you, I am trying my bestOriginally Posted by Quaint
![]()
| SitePoint Sponsor |





Thank you, I am trying my bestOriginally Posted by Quaint
![]()
Hello Quaint,
I agree with you %.
drzoid has been great.
Thank you.





Just in case you overlooked it, there is in actual response from me .... my last posting just created a new page![]()
Hello drzoid,
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'");
and
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.
Thanks.
Hello drzoid,
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
Thank you.





Does your tblAcc table have a password column at all?
Hello drzoid,
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.
Hello drzoid,
We had power failure the last time.
Thanks for your advice. I understand what you mean.
I would surely redo my design. Thanks.
Fredrick Ughimi.
Hello drzoid,
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.
e.g.
mysql_query("INSERT INTO tblStatus (password, amount) VALUES ('$password', -$amount)");
Any suggestion would greatly be appreciated.
Thank you.
Bookmarks