Home  >  Article  >  Backend Development  >  The pitfalls mysql_fetch_array is easy to fall into

The pitfalls mysql_fetch_array is easy to fall into

WBOY
WBOYOriginal
2016-08-08 09:19:24821browse

The

mysql_fetch_array() function fetches a row from the result set as an associative array, a numeric array, or both. Returns an array generated based on the rows fetched from the result set, or false if there are no more rows.

<code><span>while</span>(<span>$rows</span><span>=</span>mysql_fetch_array(<span>$result</span>)){
    <span>...</span><span>...</span><span>...</span><span>...</span><span>.</span>
}
注意一定不要把<span>$rows</span><span>=</span>mysql_fetch_array(<span>$result</span>)写在<span>while</span>外面,如果这样写:
</code>

rows=mys ql fetcha rray (

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.

The above has introduced the pitfalls that mysql_fetch_array is easy to fall into, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php-object-oriented (2)Next article:php-object-oriented (2)