PHP displays database content cyclically

Source: Internet
Author: User
PHP loop shows the database content who helped me write a PHP loop to show the database content code .. Host LOCALHOST user root password & lt; null & gt; table test field acc uses the code shown in the table for the content in this field. ------ Solution ------------------ PHPcode $ linkmysql_connect (& quot; localhost & quot;, & q PHP cyclically displays the database content
Who will help me write a PHP code to show the database content in a loop ..
Host LOCALHOST
User root
Password <Null>
Table test
Field acc


Use the code shown in the table for the content in this field.

------ Solution --------------------
PHP code
$ Link = mysql_connect ("localhost", "root") or die ("fail ". mysql_error (); mysql_select_db ('first', $ link) or die ('failed '. mysql_error (); $ query_pag_data = "SELECT acc from test"; $ result_pag_data = mysql_query ($ query_pag_data) or die ('MySQL error '. mysql_error (); while ($ row = mysql_fetch_array ($ result_pag_data) {// use $ row ['ACC '] here}

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.