Hi guys, please help if you can, in a bit of a pinch at the moment.
I have setup a basic CMS for a client, wherein she can upload products to a mysql DB, and then it spits them out on here product page.
Heres my problem:
With one portion of the product their is a swatch color option. I have check boxes setup for all the main colors. I got it to upload to the DB fine.
When I pull that data from the DB, for instance it might be
Red, Green, Blue
How can I make it so that rather than showing the word red it shows a picture of the swatch that I am referring to?
I have all of the swatches on the server I just need to figure out a way to make it happen.
Ive tried a variety of loops, exploded the array, just can't seem to figure it out.
Need help asap, thanks for reading.
If code helps
echo "<small>" . $data['colors'] . "</small><br />";
That echoes out all of the colors that she checked when uploading a file, could be just black, could be blue orange red green etc. (Comma separated).
I need to make it so that instead of showing up as black
It shows up as a picture of the black swatch.