我正在制作一个简单的脚本,将产品直接插入到 prestashop 数据库中,但我找不到如何将图像插入到数据库中。
到目前为止,我的脚本是:
mysqli_query($conn, 'INSERT INTO ps_product (id_supplier, id_manufacturer, id_category_default, id_shop_default, id_tax_rules_group, on_sale, online_only, quantity, minimal_quantity, price, wholesale_price, out_of_stock, active, redirect_type, available_for_order, show_price, indexed, visibility, cache_default_attribute, date_add, date_upd, pack_stock_type,ean13,upc,unity,reference,supplier_reference,location)
VALUES ("2", "2" , "5", "1", "1","1","1", "0", "1", "30", "30", "2", "1", "302","1","1","1","both","19",now(),now(),"3","0","0","","demo_1","","" )');
mysqli_query($conn, 'INSERT INTO ps_product_lang (id_product, id_lang, description, description_short, link_rewrite, name, available_now,meta_description,meta_keywords,meta_title,available_later)
VALUES (LAST_INSERT_ID(),"1","long des","test","insert title","title inserted","In stock","","","","")');
mysqli_query($conn, 'INSERT INTO ps_product_shop (id_product,id_shop,id_category_default,id_tax_rules_group,price,wholesale_price,unity,active,redirect_type,indexed,cache_default_attribute,date_add,date_upd )
VALUES (LAST_INSERT_ID(),"1","5","1","30","30","","1","301","1","1",now(),now())');
Run Code Online (Sandbox Code Playgroud)
现在我必须在其中插入照片,以便我可以完成产品并发布它。