//建立连接
$conn = mysql_connect('localhost','','')
or die(mysql_error());
//选择数据库
mysql_select_db('databaseName',$conn);
//sql语句
$query = "select * from your table";
//查询
$result = mysql_query($query);
//取结果集行数
$rownum = mysql_num_row($result);
//定位到最后一行
mysql_data_seek($result,$rownum);
//取出数据
$row = mysql_fetch_assoc($result);
//访问数据
echo $row[id];
echo $row[row1];
?>
<?php
//建立连接
$conn
=
mysql_connect('localhost','','')
or
die(mysql_error());
//选择数据库
mysql_select_db('databaseName',$conn);
//sql语句
$query
=
"select
*
from
your
table";
//查询
$result
=
mysql_query($query);
//取结果集行数
$rownum
=
mysql_num_row($result);
//定位到最后一行
mysql_data_seek($result,$rownum);
//取出数据
$row
=
mysql_fetch_assoc($result);
//访问数据
echo
$row[id];
echo
$row[row1];
?>