I need to update values form one table to another and create values if they are not there
How can I do this for all values or form values from one ID to another

This is the query but I need to run it for every ID and that is a lot of job, so is there any simplier way?

So id_product is always the same

`

INSERT INTO ps_product_supplier 
(id_product_supplier, id_product, id_product_attribute, id_supplier, product_supplier_reference, product_supplier_price_te, id_currency)  
VALUES(NULL, 6216, 0, (SELECT id_supplier FROM ps_product WHERE id_product = 6216), (SELECT supplier_reference FROM ps_product WHERE id_product = 6216), 
(SELECT wholesale_price FROM ps_product WHERE id_product = 6216), 3);

`

Use a select from the ps_product table to insert into ps_product_supplier. Something like this:

INSERT INTO ps_product_supplier 
(id_product_supplier, id_product, id_product_attribute, id_supplier, product_supplier_reference, product_supplier_price_te, id_currency)  

SELECT
    NULL, id_product, 0, id_supplier, supplier_reference,  wholesale_price , 3
FROM 
    ps_product

Wihout any restrictions?
With this I will owerwrite id_product?

What this script does is:

Select the specified columns from ps_products, and insert each returned row into ps_product_suplier.

The table ps_product will not be changed.

But it does not inserts anything in table, any ideas?

Or can I write PHP to do this?

Does it throw any errors?
First test only the select part and see if it returns any rows.

Yes, you could do it with PHP. You'd have to make a select on the rows you want to insert, then loop thru them and insert each record.

This select return 0 rows?

SELECT
    NULL, id_product, 0, id_supplier, supplier_reference,  wholesale_price , 3
FROM 
    ps_product

If so, it means that there's no rows in your table.

That does not work
this is in ps_product_supplier:

id_product_supplier, id_product, id_product_attribute, id_supplier, product_supplier_reference, product_supplier_price_te, id_currency

NULL is there for id_product_supplier