assign values directly?

Talk about foreign keys

Moderator: alexandrleonenko

trtrtr
Newbie
Newbie
Posts: 4
Joined: Dec 7th, '10, 13:27

assign values directly?

Postby trtrtr » Dec 7th, '10, 13:38

In this particular case, I need to assign a foreign key to a column and this value is in php variable, $product_ID
How do I do this?

This is a detail record, based on master/detail example, but I have Products and Product Options. The Options record is the detail record and has FK for the Product ID (which is passed via $_GET).
I just need to be able to assign $product_ID to the product_ID column.

In general, however, I haven't seen any example of how to easily assign some value (hard-coded or whatever) to a specified column. Everything seems to be either a lookup or data entry?

administrator
Site Admin
Site Admin
Posts: 6180
Joined: Jan 7th, '09, 23:18
Contact:

Re: assign values directly?

Postby administrator » Dec 8th, '10, 08:46

Do you need to add foreign key value (that taken from another table) or add pre-defined value, that stored in variable?
Define your foreign field as "textbox" and simply add this value manually or define it as "hidden" field and add this value as "default" value for foreign key.

trtrtr
Newbie
Newbie
Posts: 4
Joined: Dec 7th, '10, 13:27

Re: assign values directly?

Postby trtrtr » Dec 8th, '10, 12:18

Assigning "default" value did the trick. Thanks!


Return to “Field type: "foreign key"”