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.