MysqL_fetch_row用于从MysqL数据库中查询数据,并保存到list中
语法如下:
/**
* PHP MysqL MysqL_fetch_row –从查询获得数据行列表
*
* @param
* @arrange 512-笔记网: jb51.cc
**/
array MysqL_fetch_row (resource $Result_Set)
/*** 来自编程之家 jb51.cc(jb51.cc) ***/
如果执行成功,则返回list列表,如果失败,返回false 下面是演示代码
/**
* PHP MysqL MysqL_fetch_row –从查询获得数据行列表
*
* @param
* @arrange 512-笔记网: jb51.cc
**/
<?PHP
$UserName = 'abc';
$Password = '1234';
$DbHandle = MysqL_connect ('localhost',$UserName,$Password);
if (!$DbHandle) {
die 'No database connection could be established.';
}
$DBName = 'w3db;
if (!MysqL_select_db ($DBName,$DbHandle)) {
die 'Database could not be selected.';
}
$Query = "SELECT ISBN,Title,Author FROM articles";
$articles = MysqL_query ($Query,$DbHandle));
while ($Row = MysqL_fetch_row($articles)) {
echo "ISBN = $Row['ISBN']<br />\n";
}
?>
/*** 来自编程之家 jb51.cc(jb51.cc) ***/
原文链接:https://www.f2er.com/php/528429.html