There are several db tables ( phpmyadmin ) working with the web php script that I’m using (but did not write).
The ‘user’ table has many fields, but pertaining to purchases it has these fields: ‘ip_address’ ‘username’ ‘wallet’ and ‘balance’.
The ‘paid_videos’ table has these fields: id_user, video_play_price, id_video, user_id_uploaded, video_title, earned_amount, time_date, short_id, session_key
The ‘transact’ table has these fields: username, id_user, amount, balance, wallet, wal_bal, user_id_uploaded, earned_amount, time_date.
When a purchase is made a single row is populated in the ‘paid videos’ table and a single row is populated in the ‘transact’ table.
Additional info: when a purchase is made, an amount of 50% of the price (‘earned_amount’) appears in uploader’s (user_id_uploaded) ‘earned_amount’ field,
and gets added to the uploader’s ‘balance’ field.
And that amount is also reflected in ‘amount’ by a negative number, and reduces the purchaser’s ‘wallet’ or ‘balance’ by that same amount.
Also, wal_bal is total of wallet and balance.
I am looking for comments/suggestions for improvement. And/or besides improvement, what am I missing?