Desktop center (4) Data Display _ PHP Tutorial

Source: Internet
Author: User
Desktop center (4) Data Display. The last step is to display it. The following program is called Through parameters. For example, php (as the mainstream development language). php (as the mainstream development language )? The last step after jpg is displayed.
The following program is called Through parameters.
For example, php (as the mainstream development language). php (as the mainstream development language )? Jpg = jpg
Jpg is the name of the table. Remember This. Otherwise, the program will fail and an error will be displayed.
You can change the following program. In this way, it will be more beautiful.

The following is the source program:

Display


MySQL (the best combination with PHP) _ connect ("localhost", "username", "password") or die ("cannot connect to the database! ");
$ Query = "SELECT id, url, mess, fromx, url1, mess1, fromx1, url2, mess2, fromx2, url3, mess3, fromx3 from $ jpg ";
$ Result = MySQL (the best combination with PHP) _ db_query ("elong", $ query); // execute the query
$ Num = MySQL (the best combination with PHP) _ numrows ($ result );
$ Page = round ($ page );
$ Pagesize = 4;
If ($ page = 0 ){
$ Page = 1 ;}
Else {
$ Page = $ page ;}
$ Pagecount = ($ num)/$ pagesize;
$ Pagecount = ceil ($ pagecount );
?>
Printf ("homepage", $ php (as the mainstream development language) _ SELF, 1 );
Printf ("Front page", $ php (as the current mainstream development language) _ SELF, $ page-1 );
} Else {
?> Homepage front page }
?>

Printf ("", $ php (as the mainstream development language) _ SELF, $ page + 1 );
Printf ("last page", $ php (as the mainstream development language) _ SELF, $ pagecount );
} Else {?> Last page Page: / Page

If ($ num <> 0 ){
$ Pp = 0;
For ($ ipage = 0; $ ipage <$ pagesize; $ ipage ++ ){
$ I = ($ page-1) * $ pagesize + $ ipage;
If ($ I <$ num ){
$ Id = MySQL (the best combination with PHP) _ result ($ result, $ I, "id ");
$ Url = MySQL (the best combination with PHP) _ result ($ result, $ I, "url ");
$ Mess = MySQL (the best combination with PHP) _ result ($ result, $ I, "mess ");
$ Fromx = MySQL (the best combination with PHP) _ result ($ result, $ I, "fromx ");
$ Url1 = MySQL (the best combination with PHP) _ result ($ result, $ I, "url1 ");
$ Mess1 = MySQL (the best combination with PHP) _ result ($ result, $ I, "mess1 ");
$ Fromx1 = MySQL (the best combination with PHP) _ result ($ result, $ I, "fromx1 ");
$ Url2 = MySQL (the best combination with PHP) _ result ($ result, $ I, "url2 ");
$ Mess2 = MySQL (the best combination with PHP) _ result ($ result, $ I, "mess2 ");
$ Fromx2 = MySQL (the best combination with PHP) _ result ($ result, $ I, "fromx2 ");
$ Url3 = MySQL (the best combination with PHP) _ result ($ result, $ I, "url3 ");
$ Mess3 = MySQL (the best combination with PHP) _ result ($ result, $ I, "mess3 ");
$ Fromx3 = MySQL (the best combination with PHP) _ result ($ result, $ I, "fromx3 ");
$ Pp = $ pp + 1;
?>







"Target =" _ blank ">" width = "160" height = "120" border = "4"> "Target =" _ blank ">" width = "160" height = "120" border = "4"> "Target =" _ blank ">" width = "160" height = "120" border = "4"> "Target =" _ blank ">" width = "160" height = "120" border = "4">


}
}
}
?>

  Paging
     

Bytes. The following program is called Through parameters. For example, php (as the mainstream development language). php (as the mainstream development language )? Jpg = after jpg...

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.