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

The pitfalls mysql_fetch_array is easy to fall into

WBOY
Release: 2016-08-08 09:19:24
Original
885 people have browsed it

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>
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template