Hi All,
Back after a few months. Again working on some stuff, but I am just too stupid to figure this one out.. Any help is appreciated.
OK.. This is what I try to do, using PhP and MySQL:
Three tables:
Clients: ID, PCode, ...
Activities: ID, ....
ClientAct: ID, ClientNr, ActNr
where Clients.ID = ClientAct.ClientNr and Activities.ID = ClientAct.ActNr.
I would now like to find all combinations of a specific Clients.PCode and Activities.ID that exist, using ClientAct as a linking table.
Using a query like:
select * from Clients activities ClientAct
where ( (Clients.PCode = $code)
and (ClientAct.ClientNr = ClientAct.ActNr)
and (Activities.ID = 1))
gives me 10 times the same result.
Any idea on a better way to do this, or any errors which may cause the result described above?
Of course I can break it up in several seperate queries where the results of each query are the basis of the next query. But as you add tables, this become impossible to work with.
Tha,
J.