Hey Everyone....
I need some help if anyone is willing....🙂
I am currently working with an inventory list which has images associated with it.
I have already created a table for the inventory, 'inventory'.
Since each item in the inventory table could have more than one image associated with it, I have created another table, 'inventory_images'.
Now, here is where I need help. I already have the images (about 10,000). I need to populated the 'inventory_images' table and associate each file with the inventory item in the 'inventory' table.
Fortunately, the images are named according to the inventory item, e.g.
1234-1.jpg = inventory_id 1234,
1234-2.jpg = inventory_id 1234,
2233-1.jpg = item 2233 and so on.
Here are the first few columns in my inventory table:
id (auto-increment)
inventory_id
Here are the columns in the inventory_images table:
inventory_id
filename
I tried using the dir() function to read the image directory ('site_data') but I was lost after that!
Any thoughts or suggestions would be great and I thank you in advance for taking the time to read my post!!