OKAY...
So let's assume you KNOW what Category ID's relate to what Category names and their associated images.
In my example, I know that:
- Category ID 1 will need image1.jpg
- Category ID 2 will need image2.jpg
- Category ID 3 will need image3.jpg
Here's the SQL command I run:
Code:
UPDATE `categories` SET `categories_image` = 'image1.jpg' WHERE `categories_id` = 1;
UPDATE `categories` SET `categories_image` = 'image2.jpg' WHERE `categories_id` = 2;
UPDATE `categories` SET `categories_image` = 'image3.jpg' WHERE `categories_id` = 3;
(Notice correct use of back-quotes around the table columns, and single quotes around the image name).
So if you have 200 categories, you'll need 200 such UPDATE lines.
IT WOULD HELP YOU therefore, to NAME your category images the SAME AS the category ID.
So, for category ID 247, the image would be named image247.jpg (or just 247.jpg).
Then, all you need do is make sure that in each update line, the CAT ID and the IMAGE NAME are the same "number".
(You could actually compile this in a spreadsheet, then concatenate the cells to "create" the full lines. This will speed up the process considerably...)
Bookmarks