The situation is that multiple Amazon product identifiers (ASIN) can be assigned to one of our products (parts).  We have a custom field ("asin") on the Add Part screen.  When data reaches ic.pl, the code (snippet) below is exercised to insert a row in the parts table.  Since there can be multiple ASINs, it would be better to store them in a separate table with a foreign key.

I'm an experienced Python developer, but a novice at Perl.  The last three lines of code are causing the queries to not work.  What syntax should I introduce into ic.pl to store ASINs in a separate database table?

Thanks.
Brian


    $sth = $dbh->prepare($query);
    $form->{partnumber} = trim($form->{partnumber});
    $form->{description} = trim($form->{description});

    <snip>

    $sth->execute(
        $form->{partnumber},      $form->{partname},

    <snip>

        $form->{expense_accno},   $form->{obsolete},
        $form->{image},           $form->{drawing},
        $form->{microfiche},      $partsgroup_id,
        $form->{id}
    ) || $form->dberror($query);

    $query = "insert into part_asin (part_id, asin) values (?, ?)";
    $sth = $dbh->prepare($query);
    $sth->execute( $form->{id}, 'B005QUQP8U');


Activus Technologies
Brian Wolf
Phone: 410.367.2958
  • Integrated Payment Solutions
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

Reply via email to