|
Sorry could you try to clarify, or give more information, from what I can make out you have a table named BUYERS, then within that table you have a field for CLIENTES, that the clients name gets inserted into, then you have second field in the same table named BUSINESS, in that field you want to place some other sort of information, this works correctly until the point when the same client needs to be inserted again, for some other transaction, instead of inserting a new row it updaes the initial row that has the same client name.
Is that correct.
In my honest opinion, even if I am not on the right track your database structure seems a tad flawed, and it will become chunky when it grows.
If I were you I would rather have 2 tables to store this data, table 1 should look like this
Table 1's Name: Client_Info
Field 1: Client_id - This should be a primary key, and should be unique
Field 2: Client_Name
Table 2's Name: Business
Field 1: Bus_id - This should be a primary Key and Unigue, maybe even an auto increment field
Field 2: Transaction
Field 3: Client_id - This should be a foreign key that links the two tables together
This type of database design is called relational, the advantage is that everything is unique so nothing will ever overwrite, secondly it will not have duplicate data, example, you could have a single client with an id of "1", this will link to your second tables client_id field that will also be "1", if the same client has a secont transaction, it will be "1" again but it will be a different id, so it is not a duplicate.
When you want to query your data, all you need do is ask the db for a client name from table 1 where the client_id is equal to the second tables clint id, this way it will show you every transaction for that single client, etc
If this helps give me some Talkupation!
|