$DBHOST="localhost"; $DBUSER="busesdev"; $DBPWD="YqlDev12"; $DBNAME="buses_dev"; $link_id=mysql_connect($DBHOST,$DBUSER,$DBPWD); mysql_select_db($DBNAME); mysql_query("SET NAMES 'gb2312'"); $sql="select * from zt40years order by p desc"; $query= mysql_query($sql); $arr=array(); while($resut = mysql_fetch_array($query)) { $arr[]=$resut; } foreach($arr as $v){ echo "
"."".$v["p"]."".$v["id"].".".$v["name"]."
"; } ?>