MySQL语句 $record=0; $db=@mysql_pconnect('localhost','root'); @mysql_select_db('1234',$db); $strsql="select * from 1234_data"; $result=@mysql_query($strsql); $data=@mysql_fetch_array($result); $record=@mysql_num_rows($result); echo "\n"; do{ if ($record==1){ echo "".$data['cname']."\n"; } else{ echo "".$data'cname']."\n"; } }while($data=@mysql_fetch_array($result)); echo "\n"; ?>