mutil_query($result)){ //多查询
where
}
//执行查询
/*
$result=$cone->query("SELECT * from test");
while($row=$result->fetch_row()){
print $row[0];
}
$result-free();
*/
?>
real_connect("localhost","","","test");
$mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT,5); #建立mysql连接选项
if(msqysqli_connect_erron){
die(msqli_connect_error());
}else{
print /*mysqli->host_info*/
//$mysqli_get_host_info($mysqli);
//}
?>
host_info();
}
*/
?>
host_info;
}
*/
/*
$dbs=new mysqli("localhost","","","test");
if(mysqli_connect_errno){
die("mysqli_connect.failed".mysqli_connect_error());
}else{
print $mysqli->host_info();
}
*/
#函数连接
/*
$db=mysqli_connect("localhost","","","test");
//判断数据库是不是连接成功
if(empty($db)){
//返回数据库连接失败信息
die ("mysqli_connect.failed".mysqli_connect_error());
}else{
//连接成功
print mysqli_get_host_info($db);
//echo mysqli_init();
}
*/
//关闭数据库连接
#mysqi_close($db);
#require_once "8.php"; //包含函数
/*
function hashFx()
{
$data='';
$x=array();
foreach($array as $key=>$value){
$data.=$key.$value;
$x="$key=$value";
}
$hash=hash($data);
$x[]="hash=$hash";
return join('&',x[]);
# code...
}
echo '
"liupeng","age"=>18);
print_r(hash($x));
*/
?>
animalFX();
}else{
print"no have animal";
}
# code...
}
inputAnimal(new cat());
?>
catFx();
}else if($obj instanceof dog){
$obj->dogFx();
}else{
print"no animal";
}
# code...
}
animalFx(new cat());
animalFX(new dog());
?>
var_1=11;
print $var1->var_1.$var2->var_1;
?>
print_Color();
?>
y=self::$x;
# code...
}
}
$z=new myClass();
print $z->y;
$w=new myClass();
print $w->y;
/*
class staticMyclass{
static $ansewer=0;
static $word=0;
function method()
{
print self::$word;
# code...
}
}
$x=new staticMyclass();
$x->method;
staticMyclass::$ansewer++; //访问静态方法属性
print staticMyclass::$ansewer;
*/
/*
public #公有成员(函数,变量)
private #私有成员
protected #受保护成员
class Dbclass{
private $x; //只能在内部调用
function createDbConnection($x)
{
$x=$this->$x;
protected $y=$x;//包括继承类可以调用
# code...
}
public setDbConnection(){ //整个程序可以调用
return $this->x;
}
}
//继承类
class DbNodeClass extends Dbclass{
$y="hello world"
*/
/*
class whiteClass{
function __destruct(){ //析构函数
print "this is a white function";
}
}
$x=whiteClass();
$x=NULL;
*/
?>
$by=$by;
# code...
}
function getTraveal()
{
return $this->$by;
# code...
}
private $by;
}
$bike=new traveal("mile");
print $bike->getTraveal();
*/
?>