I've figured out what exactly needs to happen, I just need help writing the SQL query to achieve it. The database structure is as follows:
The table 'opproduct' holds product info, with the primary key 'product_id'. The default image URL for each product is held in the field 'image'.
The table 'opproduct_image' holds product image URLs in the field 'image' and the assigned product for each image in 'product_id'. This allows any one product to have multiple images. In order to have a default image, a product must have an image assigned in the table 'opproduct_image' and also the URL set in the table 'opproduct'.
So, the MySQL query needs to:
Find records that match the 'product_id' field in both the tables 'opproduct' and 'opproduct_image'
Now copy the value of the field 'image' in the table 'opproduct_image' to the field 'image' in the table 'opproduct'
I'm using Version 1.4.9.3. Thanks!
