Tongda OA is a case of abnormal debugging of a Data loop output program.

Source: Internet
Author: User

Tongda OA is a case of abnormal debugging of a Data loop output program (via text ).

Today, a friend in the secondary development and exchange group of Tongda OA asked this question. After connecting to the database through code, the data in the database can be displayed normally, but the code output by loop can only output a single row of data, there are actually multiple data records in the data table. Why does the loop fail?

<? Include_once ("inc/conn. php "); // if you need to connect to the database, it contains include_once (" inc/utility_all.php "); // if you need to use a public function, it contains include_once (" inc/check_type.php "); // if you need to use the type check function, include // If auth is already included. php, you do not need to include conn. php?> <Html> Streamline the Code:

<? Include_once ("inc/conn. php"); // if you need to connect to the database, include?> <? Php $ query = "select * from flow_data_50 order by id desc"; $ cursor = exequery ($ connection, $ query); while ($ ROW = mysql_fetch_array ($ cursor )); {echo "I = ". $ ROW ['id'] ;}?>

The final result is that a semicolon is added at the end of the while row, which is equivalent to the end of the loop by this line, and there is no recycling in the future, and the braces are not the same as while. So far, find the cause and solve the problem.

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.