Desktop Center (4) Data Display_PHP Tutorial

WBOY
Release: 2016-07-21 16:07:13
Original
783 people have browsed it

Source: Aosuo.com

Desktop Center (4) Data Display
Author: elong

The last step is to display.
The following program needs to be called through parameters.
For example, php.php?jpg=jpg
The jpg after
is the table name. Remember it is necessary, otherwise it will not run and a program error will be displayed. You can change the program below. This will make it more beautiful.

The following is the source program:

display


mysql_connect("localhost","username","password") or die("Unable to connect to the 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("Homepage",$PHP_SELF, 1);
printf(" previous page",$PHP_SELF,$page-1);
} else{
?> Home Page Previous Page}
?>

printf(" back page",$PHP_SELF,$page+1);
printf(" Last page",$PHP_SELF,$pagecount);
}else{?> Last page PagePage:/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");
$url1=mysql_result($result,$i,"url1");
$mess1=mysql_result($result,$i," mess1");
$fromx1=mysql_result($result,$i,"fromx1");
$url2=mysql_result($result,$i,"url2");
$mess2=mysql_result( $result,$i,"mess2");
$fromx2=mysql_result($result,$i,"fromx2");
$url3=mysql_result($result,$i,"url3");
$mess3=mysql_result($result,$i,"mess3");
$fromx3=mysql_result($result,$i,"fromx3");
$pp=$pp+1;
    ?>






< ;td width="167" height="127">



}
}
}
?>

  Paging
   printf("
Homepage",$PHP_SELF,1);
printf(" Previous page< ;/a>",$PHP_SELF,$page-1);
}else{
?> Home page previous page
printf(" Next page",$PHP_SELF,$page+1);
printf(" Last page",$PHP_SELF,$pagecount);
}else{?> Last pagePage: /page


 

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315229.htmlTechArticleSource: Aosuo.com Desktop Center (4) Data Display Author: elong The last step is to display. The following program needs to be called with parameters. For example, php.php?jpg=jpg The jpg behind is the table...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!