php - How to build a multilevel menu from associative array. -


please, need on one. want build multilevel menu, want iterate through associative array foreach loop inside smarty template. first, have mysql output: enter image description here

now try associative array it, tried fetchall(pdo::fetch_assoc), because column names same, gives me values right column:

array ( [0] => array ( [id] => 7 [name] => beta 1-3 glucan ) [1] => array ( [id] => 8 [name] => okinawa fucoidan )  

please if have ideas how process table multidimentional menu, let me know.

thank you.

either use fetch_num or create aliases in query.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -