PHP Desktop Center Four data display

Source: Internet
Author: User
The final step is to show.
The following program is called by parameters.
Like Php.php?jpg=jpg.
The following JPG is the table name. Remember that you must, otherwise you will not be able to run, will show the program error.
You can change the following procedure. This will make it more beautiful.
The following are the source programs:

<title>Show</title>


mysql_connect ("localhost", "username", "password") or Die ("Cannot join database!");
$query = "Select Id,url,mess,fromx,url1,mess1,fromx1,url2,mess2,fromx2,url3,mess3,fromx3 from $jpg";
$result =mysql_db_query ("elong", $query); Execute Query
$num =mysql_numrows ($result);
$page =round ($page);
$pagesize = 4;
if ($page ==0) {
$page = 1;}
else{
$page = $page;}
$pagecount = ($num)/$pagesize;
$pagecount =ceil ($pagecount);
?>
printf ("Home", $PHP _self,1);
printf ("front page", $PHP _self, $page-1);
}else{
?> Home Front Page }
?>

printf ("Back Page", $PHP _self, $page + 1);
printf ("Last", $PHP _self, $pagecount);
}else{?> last Page Page times: / Page

if ($num <>0) {
$pp = 0;
for ($ipage =0; $ipage < $pagesize; $ipage + +) {
$i = ($page-1) * $pagesize + $ipage;
if ($i < $num) {
$id =mysql_result ($result, $i, "id");
$url =mysql_result ($result, $i, "url");
$mess =mysql_result ($result, $i, "mess");
$fromx =mysql_result ($result, $i, "FromX");
$url 1=mysql_result ($result, $i, "URL1");
$mess 1=mysql_result ($result, $i, "Mess1");
$fromx 1=mysql_result ($result, $i, "fromx1");
$url 2=mysql_result ($result, $i, "url2");
$mess 2=mysql_result ($result, $i, "Mess2");
$fromx 2=mysql_result ($result, $i, "fromx2");
$url 3=mysql_result ($result, $i, "url3");
$mess 3=mysql_result ($result, $i, "MESS3");
$fromx 3=mysql_result ($result, $i, "fromx3");
$PP = $pp +1;
?>







"target=" _blank ">" width= "height=" border= "4" > "target=" _blank ">" width= "height=" border= "4" > "target=" _blank ">" width= "height=" border= "4" > "target=" _blank ">" width= "height=" border= "4" >

}
}
}
?>
   page Out
      printf ("Home", $PHP _self,1);
printf ("front page", $PHP _self, $page-1);
}else{
?> Home Front page printf ("Back Page", $PHP _self, $page + 1);
printf ("Last", $PHP _self, $pagecount);
}else{?> last page: / page

 

The above describes the PHP Desktop Center four data display, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • 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.