All forms seem to be working correctly right now with the register form creating my client record. The way my tables are setup, my projects records cannot exist without having a clientid attached to it.
The way the forms work is that first the client registers and is taken to the projects page (this works like a charm). The project form seems to work fine except that it can't create the record because it doesn't have the client id for it. It gives me this error:
"Cannot add or update a child row: a foreign key constraint fails (`zonapromo/Projects`, CONSTRAINT `fk_Projects_Clients1` FOREIGN KEY (`Clients_IDclient`) REFERENCES `Clients` (`IDclient`) ON DELETE NO ACTION ON UPDATE NO ACTION)"
I changed the foreign key setting for the project table hoping it would help and get this:
"Cannot add or update a child row: a foreign key constraint fails (`zonapromo/Projects`, CONSTRAINT `fk_Projects_Clients1` FOREIGN KEY (`Clients_IDclient`) REFERENCES `Clients` (`IDclient`) ON DELETE CASCADE ON UPDATE CASCADE)"
I don't know anything about database work and am really just getting into it. I'm wondering if a php session would allow me to retrieve the client id from the database and have a field in the project form retrieve the data from the session. In turn, the project from would send the clientid into the project table. I have been looking into the WA Cookies Extension and think it can be done, I just can't find how to retrieve the data from the database into the session variable.
Any help would be great.
jc