PHP Desktop Center (4) Data Display_PHP Tutorial

WBOY
Release: 2016-07-21 15:56:35
Original
761 people have browsed it

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{?> Next page Last page < ?}?>Page:/Page
< ;/span>
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;
   ?> ;









}
}
}
?>
  Paging ;font color=darkgray> printf("Home page ",$PHP_SELF,1);
printf(" Previous page",$PHP_SELF, $page-1);
}else{
?> Home Page Previous Page printf(" Next page",$PHP_SELF,$page+1);
printf(" Last page",$PHP_SELF,$pagecount);
}else{?> Next page Last page Page: /Page

< /CENTER>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318028.htmlTechArticleThe last step is to display. The following program needs to be called with parameters. For example, php.php?jpg=jpg, the jpg at the end is the table name. Remember it is necessary, otherwise it will not run and the process will be displayed...
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!