Page 1 of 1

Problem with TZTable ( MySQL )

Posted: 21.10.2007, 08:51
by rodo
Hi,

Let me explain my configuration.

Zeos: 6.6.1 - beta

Table description:
a) clients (id,name,street,city,state)
DataSource: DS_Clients
b) clients_phones (id,client_id,phonenumber) -
DataSource: DS_Clients_Phones


Properties ( clients_phones )
MasterSource: DS_Clients
MasterFields: id
LinkedFields: client_id

Everything work fine, both tables are linked i can get the
infomation of ( clients_phones ) when a record of ( clients )
is selected.

But when a new record is being inserted ( clients_phones ) show
the last record viewed in ( clients ).

Example:

Table clients (records)
1, name one, street one, city one, state one
2, name two, street two, city two, state two

Table clients_phones (records)
1, 1, 1111
2, 2, 2222


sql query: select * from clients where id = 1

clients_phones = ( 1,1,1111)

and if a new record is being inserted in ( clients )
clients_phones still show ( 1,1,1111 ), only when i post
clients_phones show a empty record.

My question is in the moment i start a new record in ( clients ),
( clients_phones ) should start a new record too or i am wrong ?

I tried to explain the best i can.

Greetings!!

Posted: 25.10.2007, 10:22
by kmr
My question is in the moment i start a new record in ( clients ),
( clients_phones ) should start a new record too or i am wrong ?
Depends on the constraints you set in your create table statements.
Could you post the create statements for detailed information?

If there is no constraint, which I assume, you have to run insert for the client_phones table. The advantage of Master/Child tables is, that you don't have to set the client_id in client_phones during inserts, because it is linked to clients id. And you don't have to use findfirst or whatever to scroll to the corresponding clients_phones entries when scrolling in clients.