Answer the question
In order to leave comments, you need to log in
SQL query to enter data?
Good afternoon, I'm doing one parsing. Here sql I blunted something.
Parsing is fine, but when downloading the goods, something is being prepared.
Parses the characteristics of the product, Screenshot of the database
Here is a screen of the admin panel of the product itself
It seems to fill in, everything is in its place. But the question arose: the
product ID goes through the request (SELECT MAX(id) FROM s_products)
. And when we click on parsing again, the products are created again, and do not update those that already exist.
Here is the request:
INSERT INTO s_products(url,name,brand_id,meta_title,meta_keywords,meta_description) VALUES ((SELECT MAX(product_id) FROM s_lang_products),'%Название%','0','%Название%','%Название%','%Название%');
INSERT INTO s_products_categories(product_id,category_id,position) VALUES ((SELECT MAX(id) FROM s_products),'24','0');
INSERT INTO s_lang_products(lang_id,product_id,name,meta_title,meta_keywords,meta_description,special) VALUES ('1',(SELECT MAX(id) FROM s_products),'%Название%','%Название%','%Название%','%Название%','NULL');
INSERT INTO s_variants(id,product_id,price) VALUES ((SELECT MAX(id) FROM s_products),(SELECT MAX(id) FROM s_products),(SELECT MAX(id) FROM s_products));
INSERT INTO s_options(product_id,feature_id,lang_id,value) VALUES ((SELECT MAX(id) FROM s_products),'5','1','%Назначение%');
INSERT INTO s_options(product_id,feature_id,lang_id,value) VALUES ((SELECT MAX(id) FROM s_products),'6','1','%Сезон%');
INSERT INTO s_options(product_id,feature_id,lang_id,value) VALUES ((SELECT MAX(id) FROM s_products),'7','1','%Ширина профиля%');
INSERT INTO s_options(product_id,feature_id,lang_id,value) VALUES ((SELECT MAX(id) FROM s_products),'8','1','%Серия (высота профиля)%');
INSERT INTO s_options(product_id,feature_id,lang_id,value) VALUES ((SELECT MAX(id) FROM s_products),'9','1','%Посадочный диаметр%');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question