Don't know if I can help, but I just completed one of these.
It looks like you have the dynamic dropdowns working. First thing that I figured out the hard way was that the recordset in your search behavior must contain the values equal to the values used in the dropdowns. Whether they are ID numbers or words. There needs to be a comparison to return the records. So if you are using 1 table for your "Class" and 1 table for your "Brand" and yet another table for your "Food Items", you will need to create a JOIN.
Here I would be using a 4th relational table that relates the brands with the foods. The foods table would have a brands column in it.
LEFT JOIN relFoods_Brands ON tblFoods.ID = relFoods_Brands.Parent_ID
LEFT JOIN tblBrands ON tblFoods.BrandID = tblBrands.BrandsID LEFT JOIN tblClass ON relFoods_Brands.Parent_ClassID = tblClass.ClassID
I think. (Fake names obviously. But you get the idea. BTW, I use "tbl" in front of all my table names accept relational tables, I use "rel". Just my way of seeing which is which.)
One thing to note, if you get an error that a column is "ambiguous", you will need to designate the table for the columns where the * is at. Similar to the way they are in JOIN...ON part where there is a "." between the table name and the column name.
In my search, I am using 2 List types and comparing them to the two URL variables passed by the dropdowns post.
Also, I noticed that after a search, you loose everything in your dropdowns. I fixed this by clicking the dynamic button for the first (parent) dropdown and using the same URL variable as the "Select value equal to:" box. In your case it might be
<?php $_GET['S_class'] ?>
This worked for my needs anyway.
Still learning JOINS and relational tables so hopefully someone will jump in if I am steering you in the wrong direction. I just know that it's Friday and you will most likely want to work on this over the weekend. Been there a lot.