Skip to content
Advertisement

Amateur trying to fix dropdown menu from SQL

I’m trying to help a friend with a website. I usually don’t work with PHP, jquery.

The dropdown has 4 levels. The first level has 4 points. The 4 points have their own sub-levels, different for each other.

I’m trying to find them and then make them display in a dropdown, directly from the database.

And I’m stuck at the second level, with this error

Notice: Trying to get property ‘subcategorie’ of non-object in …..

What I’ve managed to do, until now:

JavaScript

Advertisement

Answer

Hi You need to do a foreach loop for $subcategorieas you did for $categorii. Because you are getting an array and not a object as you got for $categorii. Here I set it around the li because it seems to be the best.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement