Unlimited classification _ PHP Tutorial

Source: Internet
Author: User
Unlimited classification. Unlimited classification: the main idea is to use fid to record the upper-level ID of the class and establish the relationship between the upper and lower levels through fid and id .? Php $ connmysql_connect (localhost, unlimited root category

// Infinite classification. The main idea is this: use fid to record the upper-level ID of the class and establish the relationship between the upper and lower levels through fid and id.

$ Conn = mysql_connect ("localhost", "root", "root") or die ("Database Connection Lost ");
Mysql_select_db ("new", $ conn );
?>
Category: Function mainfl () {global $ conn; $ result = mysql_query ("select id, fid, name from a where fid = 0 order by id", $ conn ); // The default fid = 0 indicates the first level. This can be used to identify all items with fid = 0, that is, all the first-level primary classes if ($ myrow = mysql_fetch_array ($ result) {do {?>> // $ Myrow ["id"] The output primary class ID is used to prepare the query subclass. $ myrwo ["name"] primary class name // Call the sub-class function subfl and use -- Unlimited // unlimited classification. The main idea is this: use fid to record the upper-level ID of the class and establish the upper-level relationship with the id through fid. ? Php $ conn = mysql_connect (localhost, root...

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.