Hello everyone. This is a short tutorial about menus and sub menus in PHP / MySQL. Sorry for my horrible English 🙂 I haven’t spoken English since ever.
source
Hello everyone. This is a short tutorial about menus and sub menus in PHP / MySQL. Sorry for my horrible English 🙂 I haven’t spoken English since ever.
source
22 responses to “PHP Tutorial: Menu – Sub Menu in PHP/ MySQL”
Source code link is not in server….???
O shqipe, je njesh 🙂
Falemnderit. Kam 3 dite qe i vij verdalle nje problemi te tille. Kudo qe te jesh ke nje kafe 🙂
Thank you so much, such a simple and effective way of doing it. My manager will be very impressed.
Hi, thanks for video, how use mysqli in this function.
Thanks
You are a hero!
Are you thinking of updating this tutorial to use mysqli ? Thanks
thanks so much, it's great!
thax
but how make it inside select box
Thank you,
What if I have a different MySQL table for Sub-menus? How to select parent_id from the Submenus Table? The reason is because I want to display the submenus on the main nav-bar but not in the sidebar.
Thanks
Hello. Thanks for commenting. You can achieve the desired results by adding another field to the table holding your menus / pages and name it lang. Then, by using php GET and sessions you will be able to search in the table for menus only in one language or another. I know it sound confusing 🙂 but trust me. Stick with sessions and you will succeed. 🙂 If you need any help, don't hesitate to post me. Cheers.
i want to ask you for help.i really understand your way of doing this but if i have two language to display can you help me with that i.e i want the menu to be in english and german too so what am i suppose to add.appreciate any help.
Hi. Thanks for taking time to comment my video. The mysql version used here i 5.5 but you wont have any issue using whatever mysql version available to you. Peace.
great tutorial.it was helpful.which version of mysql u used ????
I'm glad to help. Thanks for commenting.
Great tutorial simplifying what can often seem a complex process. Thanks
Thanks for commenting. In theory you are right since when the code writes the html file, it would load much faster as an include file. In practice, i don't know. You could try and post me the actual results 🙂 I could learn something from that. That's for sure :). Peace.
Hi. Thanks for commenting. Please follow my new video PHP Tutorial: Menu – Sub Menu in PHP/ MySQL ( Revised ). Peace.
You can actually require the data with just one query and work with that.
with larger menus you will gain alot in performance. its way better than making a request to SQL with each sublevel.
Sorry. I can't get to your link :(. I see … I think that you should go for jquery on @media screen size. Instead of dropping down the sub-submenu on hover, you must hide the underneath ul tags and show on parent click ( with alittle javascript workaround). I hope you can understand my english :). Cheers.
I have a basic site set up where I have used media queries @media screen and (max-width: 800px) {….} etc in the css for various screen sizes. When the screen size gets below the set width it will remove the navigation menu and replace with a dropdown list for the user to select an option. I am wanting to hardcode the whole site. I have worked through this tutorial as well for the main layout. See youtube(dot)com/watch?v=F_fhyXUH_To
Thank you for your kind words. I see that you are having trouble displaying submenus in smaller devices. Unfortunately, i have yet to see such an option in small devices. You have to come up with some sort of solution for fluid grid layouts. Like paging for example. Or you can use JQuery Mobile. What are you using Bootstrap, 960grid? Show me how you want it made.