Skip to content
Advertisement

how create sorting sql/php with parent

phpmyadmin

picture

index.php file

JavaScript

I want to show the output as shown below:

JavaScript

Advertisement

Answer

Do not do multiple SQL queries inside a for-loop! It’s inefficient. Form a single SQL query, instead. Something like:

JavaScript

Then format the results as you wish.

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