Jump to content

Recommended Posts

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

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.

They are different types of accounts. Therefore if i include them in a same table it would not see the differentiation....

:confused:  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

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.