Problems related to information display in the marquee

Source: Internet
Author: User
Information Display in the marquee & lt ;! DOCTYPE & nbsp; HTML & nbsp; PUBLIC & nbsp;-W3CDTD & nbsp; HTML & nbsp; 4.01 & nbsp; TransitionalEN & nbsp; www. w3.orgTRhtml4loose. dtd & gt; & lt; html & gt; & lt; head & gt; information display in the marquee








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 ("cocould 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 ));
?>



Echo $ html_info;
?>





Mysql_close ();
?>
When the page is running, there should be several pieces of information running, and the var_dump () function is used for output, there will be several results, but when the light is running, how can there be only one! Urgent. thank you.
------ Solution --------------------
Try this way
do{
$html_info="
    " ;
    //var_dump($show_info["telephone"]) ;
    $name=fun($show_info["username"]) ;
    $html_info .="
  • ".$name."***  ".substr($show_info["telephone"] ,0 ,7)."****
  • " ;
    }while($show_info=mysql_fetch_array($show_mysql)) ;
    $html_info .="
" ;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.