Home > Backend Development > PHP Tutorial > PHP循环展示数据库内容

PHP循环展示数据库内容

WBOY
Release: 2016-06-13 10:48:15
Original
1280 people have browsed it

PHP循环显示数据库内容
谁帮我写个PHP循环显示数据库内容的代码。。
主机LOCALHOST
用户root
密码
表test
字段acc


把这个字段里的内容用表格显示出来的代码。

------解决方案--------------------

PHP code
$link=mysql_connect("localhost","root") or die("fail".mysql_error());mysql_select_db('first',$link) or die('faill'.mysql_error()); $query_pag_data = "SELECT acc from test";$result_pag_data = mysql_query($query_pag_data) or die('MySql Error' . mysql_error());while ($row = mysql_fetch_array($result_pag_data)) { //在这里使用$row['acc'] }<div class="clear">
                 
              
              
        
            </div>
Copy after login
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