heshan Posted August 31, 2010 Share Posted August 31, 2010 HI, I have 4 account type tables savings_investment(ID,account_type,full_name,balance,interest,customer_id) shakthi(ID,account_type,full_name,balance,interest,customer_id) surathal(ID,account_type,full_name,balance,interest,customer_id) abhimani_plus(ID,account_type,full_name,balance,interest,customer_id) ID is the primary key for every table.The ID is different from one table to another. That is why i created 4 tables rather than one table. I want to write the coding to check account balances. That is if user types the Account ID(ID) and clicks on search button the relevant details regarding that account should be shown in a table. That is account_type,full_name, balance, interest and customer_id. Can anyone give me the relevant coding... Thanks, Heshan Quote Link to comment https://forums.phpfreaks.com/topic/212193-problem-arise-in-checking-account-balances/ Share on other sites More sharing options...
jayarsee Posted August 31, 2010 Share Posted August 31, 2010 You might have good reasons for this structure that I'm not aware of, but it would seem more correct at a glance to have all of those tables in 1 with an account_type field of the MySQL "set" data type. I guess I'm not understanding the part about the ID keys being different. Quote Link to comment https://forums.phpfreaks.com/topic/212193-problem-arise-in-checking-account-balances/#findComment-1105723 Share on other sites More sharing options...
heshan Posted August 31, 2010 Author Share Posted August 31, 2010 They are different types of accounts. Therefore if i include them in a same table it would not see the differentiation. This project is related to the bank. Bank does provide account numbers based on account types. Quote Link to comment https://forums.phpfreaks.com/topic/212193-problem-arise-in-checking-account-balances/#findComment-1105730 Share on other sites More sharing options...
mikosiko Posted August 31, 2010 Share Posted August 31, 2010 They are different types of accounts. Therefore if i include them in a same table it would not see the differentiation.... yes, you can ... the only thing that you need to do is add a field that represent the difference... easy and more simple.... but.. If you want to do in your way and pay the price is ok. you can solve your search creating a VIEW with the UNION of all the tables (horrible... but works)... just google for examples Quote Link to comment https://forums.phpfreaks.com/topic/212193-problem-arise-in-checking-account-balances/#findComment-1105747 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.