Jump to content

inserting data to two tables simultaneously in different fields


deepshah2004

Recommended Posts

hello I have a sales table,purchases table and stock table some of the sales and purchases table entries need to be entered into the stock table as well how to do this.

 

sales table fields:

 

sales id(primary key),date,item code,description,customer name,customer account number, quantity,unit price,amount,discount,net amount and terms

 

purchases table fields:

 

purchases id(primary key),date,item code,description,supplier name,supplier code,quantity,unit price,amount,freight charges,discount,net amount and terms

 

stock table fields:

 

 

stock id(primary key),date,sales id(foreign key),purchases id(foreign key), quantity in, quantity out, reorder level quantity,minimum order quantity,balance quantity.

 

I need the sales id of the sales table to also appear in stock table, also date to appear in date, quantity to appear in quantity out, and update the balance quantity in the stock table.

 

I need the purchases id to appear in the stock table, date to appear in date, quantity to appear in quantity out, and to update the balance quantity.

 

I am new at php

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.