$connection=mysql_connect("localhost","root","");
#test is database name
mysql_select_db("test",$connection);
#seven is table name
$query="select * from seven";
echo $query."
";
$result=mysql_query($query,$connection);
while($row=mysql_fetch_row($result)){
echo "id: ".$row[0]."
";
echo "name: ".$row[1]."
";
echo "age: ".$row[2]."
"."
";
}
?>
阅读(855) | 评论(0) | 转发(0) |