Please almighty big God answer, this function in PHP how to write? JSP code has been, seeking translation or ideas! Pass by Please look!

Source: Internet
Author: User
is to judge the content of MySQL, in the HTML control the color of the output, see below:

Links: Http://zhidao.baidu.com/link?url=rd4D37D5SxFe8fiQiJjEToUtziRhaQmYlo9QckfgBbgTHO8kXnchNhHh66N1gr7wFVdAa_ Jyh-tvzcrvyuc5hq

This demand Baidu has already answered, but is written in PHP, who can be translated into PHP? Or have your own ideas?


Reply to discussion (solution)

!--? php$conn = mysql_connect (' localhost ', ' root ', '); mysql_select_db (' Test ', $ conn); $sql = "SELECT * from Test"; $r = mysql_query ($sql); --> 

さすが manager さんです! お尻?!

  • !--? p HP while ($rs = Mysql_fetch_assoc ($r)) {if ($rs ["ifpass"] = = "Y") {echo (" "); }else{Echo (" "); }?> !--? php}echo (" "); >
    ID name ifpass
    !--? php echo $rs ["id"],?--" "!--? php echo $rs ["name"];?--> !--? php echo $rs ["Ifpass"];?--"

    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.