Php-help experts, rigid loop output array is not used well, is there a better way to output?

Source: Internet
Author: User
For example, if I want to output the data of a category table, the output array defines a channel page, and the output [category ID] is placed in a channel hyperlink, and then the category name is output. However, the company's [About Us] [News] are all articles, which can be put in article_channel.php [company album] with a lot of different content, I want to get the ID and put the link in xiangce_channel.php [company video] and put the id in video_chaanel.php. I will use while, and now I don't want to use while. Php

For example, if I want to output the data of a classification table, it turns out to be such a rigid output array.
// Read the master type.
$ SQL _0 = "select * from category where category_parent_id = 0 ";
$ Query_0 = mysql_query ($ SQL _0 );
While ($ rs_0 = mysql_fetch_array ($ query_0 ))

{
?>
">


}
?>

Define a channel page, and output the Category ID to the channel hyperlink, and then output the category name.
However, the company's [About Us] [news and trends] are all articles, which can be placed in article_channel.php.
[Company album] a lot of content is different. I want to get the ID and put the link in xiangce_channel.php.
Company video: place the id in video_chaanel.php

I will use while, and now I don't want to use while.

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.