Home PHP Libraries Other libraries PHP unlimited classification method class
PHP unlimited classification method class
<?PHP
header("Content-type: text/html; charset=utf-8");
 
$link = mysql_connect('localhost','root','eric') or die(mysql_error());
mysql_select_db('sortclass',$link);
 
class SortClass{
  var $data = array();
  var $child = array(-1=>array());
  var $layer = array(-1=>-1);
  var $parent = array();
  var $link;
  var $table;
  function SortClass($link, $table){
    $this->setNode(0, -1, '顶极节点');
    $this->link = $link;
    $this->table = $table;
    $node = array();
    $results = mysql_query('select * from '.$this->table.'',$this->link);
    while($node = mysql_fetch_assoc($results)){
      $this->setNode($node['cid'],$node['pid'],$node['cname']);
    }
  }

This is an implementation library for PHP infinite splitting, with two methods: recursive and non-recursive. Friends who need it can download it and use it.


Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

A simple method to implement infinite classification in PHP, infinite classification in php_PHP tutorial A simple method to implement infinite classification in PHP, infinite classification in php_PHP tutorial

12 Jul 2016

A simple way to implement unlimited classification in PHP, unlimited classification in PHP. A simple method to implement unlimited classification in PHP, unlimited classification in PHP. This article describes an example of a simple method to implement infinite classification in PHP. Share it with everyone for your reference, the details are as follows: Database

How Do I Link Static Libraries That Depend on Other Static Libraries? How Do I Link Static Libraries That Depend on Other Static Libraries?

13 Dec 2024

Linking Static Libraries to Other Static Libraries: A Comprehensive ApproachStatic libraries provide a convenient mechanism to package reusable...

PHP neutron class overloads the method of the parent class [parent::method name], neutron parent_PHP tutorial PHP neutron class overloads the method of the parent class [parent::method name], neutron parent_PHP tutorial

12 Jul 2016

In PHP, the subclass overloads the method of the parent class [parent::method name], neutron parent. In PHP, a subclass overloads the method of the parent class [parent::method name]. The subclass parent cannot define functions with the same name in PHP, including methods with the same name that cannot be defined in the same class, so there is no

PHP image upload class with calling method, _PHP tutorial PHP image upload class with calling method, _PHP tutorial

12 Jul 2016

PHP image upload class with calling method attached. The php image upload class is attached with the calling method. The example in this article is to share the php image upload class for your reference. The specific content is as follows. The calling method: phpheader("Content-Type:text/html; charse

How to Silence TensorFlow\'s Debugging Output? How to Silence TensorFlow\'s Debugging Output?

28 Oct 2024

Suppression of Tensorflow Debugging OutputTensorflow prints extensive information about loaded libraries, found devices, and other debugging data...

How Does jQuery Simplify DOM Manipulation for Web Developers? How Does jQuery Simplify DOM Manipulation for Web Developers?

03 Jan 2025

Overflow: Hidden and Expansion of HeightjQuery distinguishes itself from other JavaScript libraries through its cross-platform compatibility and...

See all articles