PHP MYSQL mysql_fetch_row –从查询获得数据行列表

2019-06-16 02:08栏目:技术创新
TAG: 葡京app

语法如下:

array mysql_fetch_row (resource $Result_Set)

                                如果执行成功,则返回list列表,如果失败,返回false

                                下面是演示代码

<?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";
}
?>

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:PHP MYSQL mysql_fetch_row –从查询获得数据行列表