• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

跑马灯中信息显示的有关问题

php 搞代码 3年前 (2022-01-24) 13次浏览 已收录 0个评论

跑马灯中信息显示的问题

<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>

<style type=”text/css”>
body{
margin:0px;
padding:0px;
text-align:center;
}
#right{
margin:0px auto;
padding:0px;
text-align:center;
}
ul,li{
margin:0px;
padding:0px;
}
#right li{
list-style:none;
}
</style>

<body>
<?php
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=”

    ” ;
    $html_info .=”

  • “.$name.”*** “.substr($show_info[“telephone”] ,0 ,7).”****
  • ” ;
    $html_info .=”

” ;
}while($show_info=mysql_fetch_array($show_mysql)) ;
?>

<?php
mysql_close() ;
?>
页面运行的时候,应该会有几条信息在跑动,用var_dump()函数进行输出,会有几条结果,但是跑灯的时候,怎么就只有一条呀!急,谢谢。
——解决方案——————–
这样试试
@本文9来源gao($daima.com搞@代@#码8网^搞代gaodaima码

do{<br />$html_info="<ul>" ;<br />//var_dump($show_info["telephone"]) ;<br />$name=fun($show_info["username"]) ;<br />$html_info .="<li>".$name."***  ".substr($show_info["telephone"] ,0 ,7)."****</li>" ;<br />}while($show_info=mysql_fetch_array($show_mysql)) ;<br />$html_info .="</ul>" ;

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:跑马灯中信息显示的有关问题
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址