跑马灯中信息显示的问题
nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
include_once("conn.php") ;
$show_sql="select username ,telephone from enlist_table order by enlist_id desc limit 10" ;
$show_mysql=mysql_query($show_sql) or die("Could not query".mysql_error()) ;
$show_info=mysql_fetch_array($show_mysql) ;
function fun($str){
$tmpstr="" ;
if(ord(substr($str ,0 ,1))>0xa0){
$tmpstr.=substr($str ,0 ,2) ;
}
else{
$tmpstr.=substr($str ,0 ,1) ;
}
return $tmpstr ;
}
do{
//var_dump($show_info["telephone"]) ;
$name=fun($show_info["username"]) ;
$html_info="
- " ;
- ".$name."*** ".substr($show_info["telephone"] ,0 ,7)."**** " ;
$html_info .="
$html_info .="
}while($show_info=mysql_fetch_array($show_mysql)) ;
?>
mysql_close() ;
?>
页面运行的时候,应该会有几条信息在跑动,用var_dump()函数进行输出,会有几条结果,但是跑灯的时候,怎么就只有一条呀!急,谢谢。
------解决方案--------------------
这样试试
do{
$html_info="- " ;
- ".$name."*** ".substr($show_info["telephone"] ,0 ,7)."**** " ;
//var_dump($show_info["telephone"]) ;
$name=fun($show_info["username"]) ;
$html_info .="
}while($show_info=mysql_fetch_array($show_mysql)) ;
$html_info .="









