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"); } };?>
<style>td{ text-align:center;}</style>
CountryCode | Language | Isofficial | Percentage | $r[0] | $r[1] | $r[2] | $r[3] | "; echo ""; }?>
Head ";if($page>2){ echo "Pre ";}if($pageNext ";}echo "End ";?>