Jump to content


Updating System

  • Please log in to reply
1 reply to this topic

#1 ImJustBrndn

  • Members
  • PipPip
  • Member
  • 28 posts

Posted 27 August 2006 - 05:57 AM

I am wanting to make a system on a site that allows a bar and quantity to be updated everytime someone makes a purchase. I want to be able to set a quantity say 200 and then everytime someone completes a paypal transaction and is referred to the confirmation page the quantity goes up 1/200, then 2/200, 3/200, and so on. Could someone please give me a simple way to do this. I'm a total php newbie and the more you explain the better. Thanks in advance. More than likely I'm only going to need this for 1 product a day. Thanks again.


#2 .josh

  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 27 August 2006 - 06:54 AM

one method of doing this would be to have a field in your database somewhere. just a simple int column to hold the number 1 to 200.  or even a flatfile. whatever is more convenient for you.  Everytime someone makes a purchase, simply increment the number by one.  then on your page that shows the 1/200, 2/200, 3/200, etc.. all you have to do is retrieve that number.  Or if you are keeping track of purchases in a database already, and the items have unique id's, you can simply do a query to count how many were sold. 

as far as the actual code on how to do this.. well we aren't really here to write your scripts for you.  I just gave you the logic behind it, so that's a good start.  from there, you can decide whether you want to store the number in a database or in a flatfile, then read up on how to update the number in the database, or else open a flatfile and update it, etc.. you get the picture. 
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users