My doubt is the following, I have in my database a table called articles, which has several columns among many, they are:
article_code, name, description, unit, group and stock
I suppose that from the 'Folders' article I have 10 in stock which appears in the database, but today a supplier comes and brings me 100 folders, and I want to add them to the system, I have my INSERT which would be the following:
$sqlInsert = "INSERT INTO articulos(cod_articulo, nombre, descripcion, unidad, grupo, stock) VALUES ('".$cod_articulo."', '".$_POST['nombre']."', '".$_POST['descripcion']."', '".$_POST['unidad']."', '".$_POST['grupo']."', '".$_POST['cantidad']."')";
In my POST, that is, in my HTML form, I have the quantity variable, which would be the one I want to use to record the 100 new folders. Is the INSERT okay like this or how should it be?
If the supplier arrives with N number of folders and you want to add them to the stock, first do a SELECT to that field to find out how many folders you have:
I hope it works for you.