Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Baby Registry Mysql Help


ken0306

Recommended Posts

Hi, I was trying to make my baby registry system to be able to update registry_products_quantity_received under registry_products table.

so I got stock with the sql update script.

 

so the original update script was

 

function update_quantity($products_id, $quantity = '', $attributes = '') {
  global $customer_id, $registry_mode_id;
  if ($quantity == '') return true; // nothing needs to be updated if theres no quantity, so we return true..
  $this->contents[$products_id] = array('qty' => $quantity);
// update database
if ($customer_id) tep_db_query("update " . TABLE_REGISTRY_PRODUCTS . " set registry_products_quantity = '" . $quantity . "'  where customers_id = '" . $customer_id . "' and products_id = '" . $products_id . "' AND registry_id = '" . $registry_mode_id . "'");

 

so I change to

 

function update_quantity($products_id, $quantity = '', $quantity_received = '', $attributes = '') {
  global $customer_id, $registry_mode_id;

  if ($quantity == '') return true; // nothing needs to be updated if theres no quantity, so we return true..

  $this->contents[$products_id] = array('qty' => $quantity, 'qty_rcvd' => $quantity_received);
// update database
if ($customer_id) tep_db_query("update " . TABLE_REGISTRY_PRODUCTS . " set registry_products_quantity = '" . $quantity . "' , registry_products_quantity_received = '" . $quantity_received . "' where customers_id = '" . $customer_id . "' and products_id = '" . $products_id . "' AND registry_id = '" . $registry_mode_id . "'");

 

something is wrong in there, but I don't know what it may be.

 

thank you.

ken

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...