mrjeff Posted March 26, 2003 Share Posted March 26, 2003 Firstly, hello, ive been looking at this site for some time and its great to see people sharing all this info, I hope to help some one soon, but this time, I have a question for the SQL masters that lurk in this site... We used Easy Populate to upload our products in bulk, however, this is a good hack but this has caused us a little problem and I think an SQL line of code will help us to put it right, but I am not sure how to write the code as I no nothing about SQL. If there is a way of resolving this using SQL, could some one please help otherwise I am going to have to edit every single product online one at a time. This is the problem The easy populate file asked for one image reference per product, but the shop, has a small, medium and large image option. After uploading all the products, the images worked fine, however, when we edit a product manually through the shop control panel, the shop detects that there is no image reference for the medium image and therefore will not display the image for that product anymore. So what we are asking... Is there a way using an SQL text file and relevant sql instructions to simply copy the products_image to the products_mimage rows on the data base? If so can somebody please supply it? If this is not even possible, does any one else have these issues? What was done other than manually copying and pasting the product image url to revert the situation? I appreciate all comments. Mr Jeff Link to comment Share on other sites More sharing options...
mattice Posted March 26, 2003 Share Posted March 26, 2003 This could be done with a php script I think: 1) SELECT - all product_id's in to an array 2) WHILE - loop through the array and 3) SELECT - select the image path where product_id = the one in the array loop 4) INSERT - insert into that product_id the image_path Something like that.. Mattice "Politics is the art of preventing people from taking part in affairs which properly concern them" Link to comment Share on other sites More sharing options...
alfaowner Posted March 27, 2003 Share Posted March 27, 2003 Any ideas anyone? 3000 products will take a while to change, I used EP also! Link to comment Share on other sites More sharing options...
wasson65 Posted March 27, 2003 Share Posted March 27, 2003 In phpmyadmin, try these lines UPDATE products SET product_bimage=product_image; and UPDATE products SET product_mimage=product_image; That should do it. Link to comment Share on other sites More sharing options...
alfaowner Posted March 27, 2003 Share Posted March 27, 2003 Please forgive me... How do you mean? I get this error, I am using phpmyadmin but I am unsure where I am suppossed to run this file. Thanks again --------------------- Error SQL-query : UPDATE products SETproduct_bimage = product_image MySQL said: Unknown column 'product_bimage' in 'field list' Link to comment Share on other sites More sharing options...
alfaowner Posted March 28, 2003 Share Posted March 28, 2003 Anyone? Just keeping this up front! Link to comment Share on other sites More sharing options...
Guest Posted March 28, 2003 Share Posted March 28, 2003 Well.....keeping it up front is a waste of band width and against the forum rules. We are all volunteers....We get tired and go to bed, we stop to eat, and we have families and lives......be patient. If you don't get a response after a day or two, then repost your question again with some additional information. In the meantime....try the search function or just read the forums......You'll be amazed at what you'll find. :D Link to comment Share on other sites More sharing options...
alfaowner Posted March 28, 2003 Share Posted March 28, 2003 I would abide by rules if I was made aware of them??? I am trying to help others also, its not a waste of bandwidth, I am not the only person suffering from this issue... I have searched, i have hit my head against the wall. I have also given stacks of detailed info... I will honour the rules when I know what they are of course :) Link to comment Share on other sites More sharing options...
Guest Posted March 28, 2003 Share Posted March 28, 2003 Perhaps, you missed the link to the FAQ/Rules on the upper right of the page? Link to comment Share on other sites More sharing options...
alfaowner Posted March 28, 2003 Share Posted March 28, 2003 Tried to do this SQL in phpmyadmin again, but to no avail, can someone guide me please? Link to comment Share on other sites More sharing options...
mstone Posted March 28, 2003 Share Posted March 28, 2003 This snippet entered into the SQL area of phpMyAdmin should work. You can also save this snippet as a file called change.sql then from a command prompt mysql catalog <./change.sql SELECT * FROM `products` ; UPDATE products SET products_mimage=products_image; I hope this does it for you. -Matt Stone Allegro Consultants LTD Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.