Skip to content
Advertisement

Tag: one-to-many

Displaying php mysqli query result with one to many relationship

Current: Process Skill Process A Skill_1 Process A Skill_2 Process A Skill_3 Process B Skill_1 Process B Skill_2 Expected Result: Process Skill Process A Skill_1, Skill_2, Skill_3 Process B Skill_1, Skill_2 Sample SQL: Need help how to rearrange my one to many relationship table. Tried using array “$array= array($row[‘skill_req’]) ” but does not recognize the skill_req variable. Answer You’re looking

Laravel update model’s one-to-many relation’s items

I have two Eloquent models: Item’s columns are id, userId and name. When I want to update the user (PUT /users/<id>) I also want to update the items in the same request, meaning: Skip existing items Add new items Remove extra items Afterwards both DB and the relation should have up-to-date items. Example of the request data: I tried to

Doctrine 2: Saving Entity in Complex Relationship

I have the following relationships within my doctrine entities: FavoriteRecipe Recipe User In one of my controllers I have the following code: But this throws an exception with the following message: A new entity was found through a relationship that was not configured to cascade persist operations: EntitiesUser@00000000408bd010000000007cb1380e. Explicitly persist the new entity or configure cascading persist operations on the

Advertisement