error_reporting(0);
mysql_connect('*', '*', '');
mysql_select_db('*');
mysql_query("set names 'utf8'");
//已知的数据变量有
$name = '李四';
$age = 18;
$class = '高三一班';
$sql = "INSERT INTO user (name,age,class) VALUES ('$name','$age','$class')";
mysql_query($sql);
$uid = mysql_insert_id();
echo '1';
终于通过了!
mysql_connect('*', '*', '');
mysql_select_db('*');
mysql_query("set names 'utf8'");
//已知的数据变量有
$name = '李四';
$age = 18;
$class = '高三一班';
$sql = "INSERT INTO user (name,age,class) VALUES ('$name','$age','$class')";
mysql_query($sql);
$uid = mysql_insert_id();
echo '1';
终于通过了!
2020-06-11
class Car {
private $s = 0;
function getS() {
return $this->s;
}
protected function sUp() {
$this->s += 10;
echo $this->getS();
}
function start()
{
$this->sUp();
}
}
$car = new Car();
$car->start();
?>
这样也是对的 只不过验证 start()需要public
private $s = 0;
function getS() {
return $this->s;
}
protected function sUp() {
$this->s += 10;
echo $this->getS();
}
function start()
{
$this->sUp();
}
}
$car = new Car();
$car->start();
?>
这样也是对的 只不过验证 start()需要public
2020-06-11