意思就是我需要帮助。
有意帮助者邮箱联系[email protected] 
若能解决万分感谢! 

解决方案 »

  1.   

    查询数据库里的任何表,并把全部数据显示在PHP页面上
    //中文编码
    <meta charset="utf-8"/>
    <?php
    /**
    连接数据裤
    1.主机名称
    2.用户名
    3.密码
    **/
    $link = mysql_connect("localhost","root","123456");
    //选择要使用的数据库
    mysql_select_db("dbphp");
    //对数据库查询的SQL语句,想查什么表只需要把后面的student表名替换掉就行了
    $strsql= "select * from student";
    //执行查询
    $result=mysql_query($strsql,$link);
    //提取数据库信息,并以表格的形式打印
    echo " <table border=9>\n";
    echo " <tr>\n";
    //获取表头信息用函数mysql_fetch_field()
    while ($field=mysql_fetch_field($result)){
    echo " <td>".$field->name." </td>\n";}
    echo " </tr>\n";
    //获取第一行信息用mysql_fetch_row()
    while ($row=mysql_fetch_row($result)){
    echo " <tr>\n";
    //遍历所以需要显示出来的信息
    for($r=0;$r <count($row);$r++){
    echo " <td>".$row[$r]." </td>\n";
    }
    echo " </tr>\n";
    }
    echo " </table>\n";
    echo " </p> </center>";
    //释放资源
    mysql_free_result($result);
    //关闭连接
    mysql_close($link);
    ?>