Help for this page

Select Code to Download


  1. or download this
    $clref = $dbh->prepare ("SELECT color FROM item WHERE prod_id = ".$ref
    +->{product_id});
                   $clref->execute();
    ...
                   while (my $color = $clref->fetchrow_hashref()) {
                   push @{$ref->{color}}, $color->{color};
                      }
    
  2. or download this
    $clref = $dbh->prepare ("SELECT item_id, color FROM item WHERE prod_id
    + = ".$ref->{product_id});
                   $clref->execute();
    ...
                   while (my $color, $item_id = $clref->fetchrow_hashref()
    +) {
                   push @{$ref->{color}, {$ref->{item_id}}, $color->{color
    +}, $item_id->{item_id};
                      }
    
  3. or download this
    sub add_item
    {
    ...
        $cart_ref->{$item_id}->{qty} = $qty;    
                    $cart_ref->{$item_id}->{color} = $color;    
    }