Home > Backend Development > PHP Tutorial > php访问数据库分页显示

php访问数据库分页显示

WBOY
Release: 2016-06-23 13:36:57
Original
1084 people have browsed it

1、前言

对于mysql数据库,为便于学习等,新安装的mysql中含有一个叫做world的数据库,该数据库含有一些信息,本文以此为实验素材。本文参考了php经典编程265例。

2、上代码

<?php class mysql{		var $host;		var $user;		var $pwd;		var $db;		var $con;				function __construct($host, $user, $pwd, $db){			$this->host=$host;			$this->user=$user;			$this->pwd=$pwd;			$this->db=$db;			$this->connect();		}		function connect(){			$this->con=mysql_connect($this->host,$this->user,$this->pwd);			mysql_select_db($this->db,$this->con);			mysql_query("SET NAMES UTF-8");		}	};?>
Copy after login
<style>td{	text-align:center;}</style>
Copy after login
"; echo ""; echo ""; }?>
CountryLauguage
CountryCode Language Isofficial Percentage
$r[0] $r[1] $r[2] $r[3]

Head    ";if($page>2){ echo "Pre    ";}if($pageNext    ";}echo "End    ";?>


3、实验截图



Related labels:
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