'SQL how do I INSERT INTO a tables from other seperate tables

I want to insert values into a table ,with values coming from separate tables as well as a php file,but i also need there to be a where clause. I have no idea how to do this so any help would be appriated.

The current SQL to get an idea whats going on is:

INSERT INTO order1(Order_ID,Supplier_ID,Product_ID,Stock_Amount,Reorder_Time,Postcode Amount_Ordered,Telephone_Number) VALUES(product.product_ID,:supplier_ID,product.Stock_Amount,:stockamount,supplier.Reorder_Time, supplier.Postcode,:Amount_Ordered,supplier.Telephone_Number) WHERE product.product_ID=:product_ID

(:Variable is just some data being passed into by a php file and product and supplier are just other tables)

The code doesnt need to be efficient it just needs to work, Any help is very much appricitated



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source