<?php $id=3;$link = mysql_connect('localhost','root','123456'); //连接mysql$re=mysql_select_db(test,$link);//选择数据库test$sql = 'select * from xxx where id='.$id;//id sql条件语句 xxx改为你的表$result = mysql_query($sql,$link);//获取结果集$row=mysql_fetch_assoc($result);//单行echo $row['age']; //输出'age'列值16echo $row['day'];//输出'day'列值89?>