[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Help! Still Lost in Perl
****** message to minivend-users from "Bill Randle" <billr@exgate.tek.com> ******
Chris,
On Mar 25, 7:13pm, Chris Rapier wrote:
} Subject: Re: [mv] Help! Still Lost in Perl
} ****** message to minivend-users from Chris Rapier <rapier@psc.edu>
******
}
} I think I might have found another problem though.
} The original code to access a field was:
} $field = $ref->field($column, $cart_sku);
}
} But this produced an error which said there
} was no column '1590', which is actually the sku value.
} By swapping the two values to:
} $field = $ref->field($cart_sku, $column);
}
} I was able to get the right information.
}
} Again, this might be something on my end or it might
} be a documentation problem. I'm not sure. I'm going
} to do some more testing with the $Db methods and
} see what I can find out.
>From a quick look at the code (lib/Vend/Table/Common.pm), I
believe you are correct and the documentation has it backwards.
*** 10.00.MiniVend_Perl_Objects.html.orig Wed Mar 1 23:00:31 2000
--- 10.00.MiniVend_Perl_Objects.html Sat Mar 25 17:06:50 2000
***************
*** 163,184 ****
To get a reference to a particular table, specify its hash element:
<P>
! <PRE> $ref = $Db->{products};
</PRE>
<P>
The methods available:
<P>
<PRE> # access an element of the table
! $field = $ref->field($column, $key);
</PRE>
<P>
<PRE> # set an element of the table
! $ref->set_field($column_name, $key, $value);
</PRE>
<P>
<PRE> # atomic increment of an element of the table
! $ref->inc_field($column_name, $key, 1);
</PRE>
<P>
<PRE> # see if element of the table is numeric
--- 163,184 ----
To get a reference to a particular table, specify its hash element:
<P>
! <PRE> $ref = $Db{products};
</PRE>
<P>
The methods available:
<P>
<PRE> # access an element of the table
! $field = $ref->field($key, $column);
</PRE>
<P>
<PRE> # set an element of the table
! $ref->set_field($key, $column_name, $value);
</PRE>
<P>
<PRE> # atomic increment of an element of the table
! $ref->inc_field($key, $column_name, 1);
</PRE>
<P>
<PRE> # see if element of the table is numeric
-Bill
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list