Your Insert statement on line 44 doesn't look to be correct. The column names and the values need to be in sync. The second column specified was agent_id but the second value is $price. Yoy are also missing a comma after agent_id.
For an insert you can use the alternate format
set a='xxxxx', b='yyyyy',...
This makes it easier to be sure that everything is specified properly.
chrishea
Nearly a Posting Virtuoso
1,485 posts since Sep 2008
Reputation Points: 223
Solved Threads: 243
Skill Endorsements: 5
Your Insert needs to have an agent_id in the Values list to insert into the table. The question is: where is that agent_id coming from? Is it entered and passed to this module as a $_POST variable or is it coming from somewhere else? You need to answer that then use the variable in the Values list. If you know the member name and need to get the id, you'll have to Select from the MyMembers table by the name in order to get the ID.
There is no magic to this. For the tables to be linked by agent id you must provide the appropriate agent_id value to insert into the row in the products table.
chrishea
Nearly a Posting Virtuoso
1,485 posts since Sep 2008
Reputation Points: 223
Solved Threads: 243
Skill Endorsements: 5