Two solutions for php infinitus classification implementation

Source: Internet
Author: User
This article introduces two solutions for the implementation of infinitus classification in php. If you need it, refer to this article to introduce two solutions for the implementation of infinitus classification in php. For more information, see

Method of classify one

 0) {echo "script location. href = 'OK. php? Act = list 'script ";} else {echo" script "alert ('add failed'); script";} // if the value is not equal to 0 else {// locate the type_p_id $ SQL = "select type_p_id from 'types' where type_id = $ type_id" based on typeid "; $ res = mysql_query ($ SQL); $ res = mysql_fetch_assoc ($ res); $ type_id = $ res ['Type _ p_id ']; // insert the name into $ SQL = "insert into types set type_name = '{$ type_name}'"; $ res = mysql_query ($ SQL ); // obtain the last executed id and perform data update. The main update is type_p_id $ id. = Mysql_insert_id (); $ SQL = "update types set type_p_id = '$ type_id $ id, 'where type_id = $ id"; $ res = mysql_query ($ SQL ); if ($ res) {echo "script location. href = 'OK. php? Act = list 'script ";} else {echo" script "alert ('add failed'); script" ;}} elseif ($ act = "add") {?>
 
 
 
Id Category name Path Operation
"> Edit |"> Delete

Types table:

Method of classify two

 
 0) {echo "script location. href = 'Two. php? Act = list 'script ";} else {echo" script "alert ('add failed'); script";} elseif ($ act = "list") {// sort the list by category layer $ SQL = "select * from type order by concat (type_id, type_p_id )"; $ res = mysql_query ($ SQL);?>
 
 
Id Category name Path Operation
"> Edit |"> Delete

Type table:

I hope you will forgive me for not writing well.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.