Skip to content
Advertisement

How to display data one to many relationship using php and mysql

I have a lot of products and each product has many flavour. How can i display one product name with multiple flavor. below is the script that i have tried. It doesn’t display anything. I’m really new to php.

JavaScript

Advertisement

Answer

I would start with a simpler query…

JavaScript

…and handle any remaining display issues in the application code, so a simple transformation of your resulting array.

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