Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

joshuajohnson2896's avatar

Creating a record with a foreign key that points to reference table

Hello, I have a somewhat simple questions about how to correctly reference a table for a foreign key. So In have two tables, a Transaction table, and an Transaction Source table. Now the relationship between these two tables is One to One, also their are only three values used in the Transaction Source for now, "Vendor", "Sponsor", and "Participant". I have a foreign key in the Transaction table that I would like to reference the Transaction Source table to get one of these values when I create a new record. now my question is how would I go about doing this, could i simply associate the ID from Transaction Source to the Foreign key in my Transaction table, or is there another method of achieving what I asking.

0 likes
0 replies

Please or to participate in this conversation.