php列出mysql表所有行和列的方法

前端之家收集整理的这篇文章主要介绍了php列出mysql表所有行和列的方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

本文实例讲述了PHP列出MysqL表所有行和列的方法分享给大家供大家参考。具体实现方法如下:

代码如下:
Selecting Data PHP $user = "root"; $pass = ""; $db = "mydatabase"; $link = MysqL_connect( "localhost",$user,$pass ); if ( ! $link ) { die( "Couldn't connect to MysqL: ".MysqL_error() ); }MysqL_select_db( $db,$link ) or die ( "Couldn't open $db: ".MysqL_error() );$result = MysqL_query( "SELECT * FROM domains where sex='F'" ); $num_rows = MysqL_num_rows( $result );print "

$num_rows women have added data to the table

\n";print "MysqL_fetch_row( $result ) ) { print "

希望本文所述对大家的PHP程序设计有所帮助。

猜你在找的PHP相关文章