Web Haunt

Web Development Tutorials & Web Developer Resources

Skip to content
Menu
  • Home
  • PHP
    • Installation and Configuration
  • Live Demos

Tag: single query get multi-level category

Finding all parent categories in MYSQL

Posted onDecember 1, 2016January 3, 2021by WebHaunt Team
In this tutorial We have share how to get all parent categories from child category with a single query in MYSQL I do this: $childCategoryID = 55 SELECT c.* FROM ( SELECT @r AS _id, (SELECT @r := parent_id FROM category WHERE id = _id) AS parent_id, @l := @l + 1 AS level [...]
Read More

Latest Posts

  • Create Pagination Using PHP and MySQL
  • To-Do List Application Using PHP, MySQL and AJAX
  • NodeJS Login and Registration Rest API with MongoDB
  • Build a Contact Form in CodeIgniter with Email
  • Compress Image Before Upload using PHP
Copyright © 2016 - 2026 WEBHAUNT.COM All rights reserved.