cart php amount [closed]

1

I have a cart made in php and the products are in the database, as I do to place a restriction on a particular product eg: The product number 4 in my database I want the quantity of it only goes up to 100. Thank you for being able to help.

    
asked by anonymous 19.05.2015 / 04:21

1 answer

0

You can do this via software, create a field with the amount of each product and its maximum in the database.

When you make the queries, search the database and check if the limit has already been reached and have the necessary control.

Another way is to make a procedure in your database to run before each insert. If the table has availability, enter. Otherwise, it sends a warning and does not enter. It depends on the database, but usually this can be done using PL / SQL.

    
22.05.2015 / 05:44