Mfred Posted March 9, 2007 Share Posted March 9, 2007 I am working on a feature to automate the xsell process through a txt file. But I have troubles with the SQL statement where I need to only insert those article numbers, which are already integrated in the shop. I even dont know if the EXISTS can be put there or if it should be done another way. 'INSERT INTO ' . TABLE_PRODUCTS_XSELL . ' (products_id,xsell_id) values ( (SELECT `products_id` FROM ' . TABLE_PRODUCTS . ' WHERE `products_model` LIKE ' . $data[0]. ' AND `products_status` =1 and exists `products_id` not null), (SELECT `products_id` FROM ' . TABLE_PRODUCTS . ' WHERE `products_model` LIKE ' . $data[1] . ' AND `products_status` =1 and exists `products_id` not null) ) ' Without the EXISTS syntax it is working along the file until the 1st non existing article in the shop appears. thx for your input. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.