$sql = "insert into user(name, age, class) values('{$name}', '{$age}', '{$class}')";
mysql_query($sql);
$sql="select id from user";
echo mysql_query($sql);
mysql_query($sql);
$sql="select id from user";
echo mysql_query($sql);
2016-03-16
class Truck extends Car {
public function Truck(){
$this->speed +=50;
return $this->speed;
}//定义继承于Car的Truck类
}
public function Truck(){
$this->speed +=50;
return $this->speed;
}//定义继承于Car的Truck类
}
2016-03-16
<?php
class Car {
public $speed = 0;
//增加speedUp方法,使speed加10
public function speedUp(){
$this->speed +=10; //+= 是缩写 也可以写成这样 $this->speed = $this->speed + 10;
}
}
$car = new Car();
$car->speedUp();
echo $car->speed;
class Car {
public $speed = 0;
//增加speedUp方法,使speed加10
public function speedUp(){
$this->speed +=10; //+= 是缩写 也可以写成这样 $this->speed = $this->speed + 10;
}
}
$car = new Car();
$car->speedUp();
echo $car->speed;
2016-03-16
function __destruct() {
print “析构函数被调用 \n”;
}
ps:这个双引号是中文的
print “析构函数被调用 \n”;
}
ps:这个双引号是中文的
2016-03-14