当前位置:编程学习 > php >>

php读取mysql全部内容并显示出来的代码

请问怎样实现 php读取mysql数据库表数据并全部显示
适合新手学习的用php读取mysql全部内容,然后显示出来的代码,喜欢就收藏吧

<?php
    mysql_connect("localhost", "mysql_user", "mysql_password") or
        die("Could not connect: " . mysql_error());
    mysql_select_db("db_zzzyk");

    $result = mysql_query("SELECT * FROM zhaoxi_net");

    while ($row = mysql_fetch_array($result)) {
        print_r( $row);
    }

    mysql_free_result($result);
?>

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,