#1
Hi,
I have an issue with my sidebar dropdown over populating with array values.
My controller looks like this:


My view file looks like this:


Question is why is the foreach loop over populating with array records which should be placed instead in each of the dropdowns?

I have posted this question over at speed coding academy members forum with an image highlighting my problem, so my apologise for the duplicate question.

Thanks, TekTime
#2
Try using DISTINCT in your query.
Dan
#3
Hi TekTime,

You are going to have to share a bit more database information than you have.

A json($data['item_col'], true) would help see the data too.


Could you please also upload SQL dumps of the 3 tables you are trying get the colour palette options?

I see on the SCA forum, you have posted the same question >> https://ums.myds.me/phpbb/viewtopic.php?f=7&t=1187&p=4996#p4996
#4
Hi DC,
My apologise for the delay. I will get all the particulars over to you tomorrow.

TekTime
#5
Hi,
Finally managed to resolve my issue, I was doing my arrays for the sidebar incorrectly. I have it correctly working using PHP lodash.

A huge thanks to the team for the support.

TekTime
#6
Hey Tektime,
Could you share your solution?
Dan
#7
Hi,

absolutely Dan, would you like me to post my solution over at speed coding academy forum since I am unable to post images here or would you like me to just post the code with comments here?
#8
Both if you can
Thanks again!
#9
Hi,
I have add the SQL dump with table data alongside my solution over at SCA Members Forum.

Thanks

TekTime
#10
Hi Tektime,

Thanks for posting your db but I could not get your original query to work with the item_colour - but glad you have solved the issue you had with repeating options.

I like your view query too for img_colour_v2