almoodie has asked for the wisdom of the Perl Monks concerning the following question:
Why are the $values[0] and $values[1} entries not set correctly?my @nametape =( [24, 101], [25, 102], [23, 103], [21, 104], [26, 105], [22, 106], ); foreach $line (@nametape) { my @values = split(' ',$line); $products_id = $product_number; $options_id = 10; $options_values_id = $values[0]; $options_values_price = 0.00; $price_prefix = "+"; $products_options_sort_order = $values[1]; $query = $dbh->prepare(" INSERT INTO products_attributes (products_id, options_id, options_ +values_id, options_values_price, price_prefix, products_options_sort_ +order) VALUES ('$products_id', '$options_id', '$options_values_id', '$op +tions_values_price', '$price_prefix', '$products_options_sort_order') + "); $query->execute or exit; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach and lists
by kcott (Archbishop) on Mar 14, 2013 at 03:01 UTC | |
|
Re: foreach and lists
by Athanasius (Archbishop) on Mar 14, 2013 at 02:54 UTC | |
|
Re: foreach and lists
by choroba (Cardinal) on Mar 14, 2013 at 09:38 UTC | |
by hippo (Archbishop) on Mar 14, 2013 at 12:35 UTC | |
by almoodie (Initiate) on Mar 14, 2013 at 14:51 UTC |