Web Design Forum: Auto Deduct Inventory Issue - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Auto Deduct Inventory Issue Built an E commerce website that handles everything apart from invento Rate Topic: -----

#1 User is offline   Webby 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 24-May 11
  • Reputation: 0

Posted 24 May 2011 - 06:08 PM

Hi

I have built an E commerce website that handles everything apart from inventory. (Stock Control)

I am using PayPal Express Checkout for my payment gateway, so the payment is processed on my website.

The problem is deducting the quantity purchased from the stock value in the database.

I want to do this via a simple loop. However I just cannot make it work.


<?php
while (!$eCart->EOF()) {
mysql_select_db($database_ecart2, $products);
$query_itemQ = "Update Products SET Products.ProductStock = Products.ProductStock -
$DetailQuantity WHERE Products.ProductID = $idCall"; 
$itemQ = mysql_query($query_itemQ, $products) or die(mysql_error());
$eCart->MoveNext();
}
$eCart->MoveFirst();
?>


Hope someone can help... :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users