The while in the function that doesn't understand

Source: Internet
Author: User
The while in a function that doesn't understand

function wuming () {
Global $mysqli;
$x = "SELECT * from X";
$xun = $mysqli->query ($x);
$i = 0;
while ($x = $xun->fetch_assoc ()) {
echo $a = $x [' Name '], $i + +.
Wumingshengcheng ($a);
}
}


Wumingshengcheng is a 1 function that generates HTML.
Through the passage of $ A to cycle through the 1 columns of the article.

When executing wuming (); When
Inside the while loop the first, executes the Wumingshengcheng ();
In the loop while also echo $a out but does not execute Wumingshengcheng ();

The result of the output is

$a output succeeded
$a build succeeded
$a output succeeded
And then there's no context.

In while, if Wumingshengcheng ($a) is not executed;
The output is complete. For example, there are 5 records in $ A. can be fully output.

Share to:


------Solution--------------------
while ($x = $xun->fetch_assoc ()) {
echo $a = $x [' Name '], $i + +.
Wumingshengcheng ($a);
}
Can this be done?
If it is, that's Wumingshengcheng's problem.
------Solution--------------------


$mysqli->close ();
------Solution--------------------
Then you put out the Wumingshengcheng code.

------Solution--------------------
Didn't you say The last is $mysqli->close ();It?
  • 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.