danielforsyth Posted March 7, 2006 Share Posted March 7, 2006 I am new to php and to paypal, but I don't think this question is very hard...I have an "inventory_count" column in a mysql table. I want the inventory count to subtract one every time I sell that item through paypal. I have the IPN script from the paypal site and I added a few lines of code to try to accomplish this task... but the inventory_count remains unchanged. I have my sandbox account set to reference this script in the IPN section. Can somebody tell me what I am doing wrong? I only added the part between "process payment" and "else if".And for some reason I get an error when I try to post all the code here... but here is what I added:$query = "SELECT inventory_count FROM tm_inventory WHERE id = $item_number";$result = mysql_query($query);$row = mysql_fetch_array($result, MYSQL_ASSOC);$inventory_count = $row['inventory_count'];$new_inventory_count = $inventory_count - 1;$query2 = "UPDATE tm_inventory SET inventory_count = '$new_inventory_count' WHERE id = $item_number";mysql_query($query2); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.