[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
[mv] Problems writing to database
****** message to minivend-users from Chris Rapier <rapier@psc.edu> ******
I'm trying to write a new value to the products database. I'm using the
internal minivend database format. I have "Database products
WRITE_ALWAYS 1" set in the catalog.cfg. I'm attemting to write to the
database with the following code:
[item-list]
[perl tables="products"]
$Document->hot(1);
$ref = $Db{products};
$column = "quantity";
$cart_sku = $Items->[$i]{'code'};
$cart_quantity = $Items->[$i]{'quantity'};
$db_quantity = $ref->field($cart_sku, $column);
$difference = $db_quantity - $cart_quantity;
$ref->set_field($cart_sku, $column, $difference);
$i++;
return "";
[/perl]
[/item-list]
But I get the following error everytime this code is called.
10.1.1.2 6AZ8CFoA:10.1.1.2 - [23/April/2000:18:12:31 -0400]
SteelCityCards /cgi-bin/SteelCityCards/process.html Attempt to set
products::quantity::1571 in read-only table
What am I doing wrong? I've tried putting [tag flag write]products[/tag]
before the perlcode but that gives the same error. Can anyone help on
this?
-
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