Who can explain the meaning of this sentence in detail?

Source: Internet
Author: User
Who can explain the meaning of this sentence in detail? While ($ row = mysql_fetch_assoc ($ result )):

Explanation


Reply to discussion (solution)

When the execution returns a result that is not empty, the loop continues.
It is difficult to control the use of while.

1. while (condition) {dosomething ();} when condition = true, dosomething () is always executed; otherwise, the loop is jumped out.
2. $ row = mysql_fetch_assoc ($ result) value assignment. If no more rows exist, false is returned.

In summary, dosomething (); is always executed before the database has no data.

In addition, it seems that mysql_fetch_assoc () is not recommended for php now. you can try to replace mysqli or pdo.

1. while (condition) {dosomething ();} when condition = true, dosomething () is always executed; otherwise, the loop is jumped out.
2. $ row = mysql_fetch_assoc ($ result) value assignment. If no more rows exist, false is returned.

In summary, dosomething (); is always executed before the database has no data.

In addition, it seems that mysql_fetch_assoc () is not recommended for php now. you can try to replace mysqli or pdo.




What does mysql_fetch_assoc mean?


1. while (condition) {dosomething ();} when condition = true, dosomething () is always executed; otherwise, the loop is jumped out.
2. $ row = mysql_fetch_assoc ($ result) value assignment. If no more rows exist, false is returned.

In summary, dosomething (); is always executed before the database has no data.

In addition, it seems that mysql_fetch_assoc () is not recommended for php now. you can try to replace mysqli or pdo.




What does mysql_fetch_assoc mean?


Returns the result row as an array.

What does mysql_fetch_assoc mean?



The official manual is the best tutorial.
Http://php.net/manual/zh/function.mysql-fetch-assoc.php

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.