PHP calls the database data and the output results are repeated once.

Source: Internet
Author: User
PHP calls the database data output result once. The table contains two contents: 11111111111111111111111112222222222222222222222222 PHPcode & lt ;? Php sets the database variable $ db_hostlocalhost; $ db_userroot; $ db_passw123456 for help: PHP calls the database data and the output result is always repeated once.
The table contains two contents:
1111111111111111111111111
2222222222222222222222222

PHP code
  
  Username; $ bbsname = $ mem-> bbsname; $ bbstype = $ mem-> bbstype;?>
  • .Lingd.cn/"target =" _ blank ">

    [ ]



  • The output content is as follows:
    11111111111111111111111111
    22222222222222222222222222
    11111111111111111111111111
    22222222222222222222222222

    How is this going on?

    ------ Solution --------------------
    Discussion

    Reference:
    Reference:

    Reference:
    While ($ mem = mysql_fetch_assoc ($ result) // starts the loop
    {
    Echo $ men ['username'];
    Echo $ men ['bbsname'];
    }

    Will this be repeated? Look
    ?>


    In this way, the output is blank and cannot be output.


    In the Loop var_dump ($ m ......

    ------ Solution --------------------
    Box. innerHTML + = box. innerHTML;
    In this case, the value of box. innerHTML is '123 ';
    Then, after box. innerHTML + = box. innerHTML;, box. innerHTML is '123 ';

    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.