蛤蛤
版主
首席花蛤
查看详细资料
TOP
知知了了
知了老大
1, select * from table_name where id='mysql_insert_id()';
查看个人网站
2, select * from table_name limit 0,1;
3, function gettomorrow() { $seconds = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); $tomorrow = date("Y-m-d",$seconds); return $tomorrow; }
4, <?php class animal { var $animalkind; function run() { echo $this->animalkind." can run."; } function fly() { echo $this->animalkind." can fly."; } function swim() { echo $this->animalkind." can swim."; } } $elephant = new animal(); $bird = new animal(); $seapig = new animal(); $elephant->animalkind = 'elephant'; $bird->animalkind = 'bird'; $seapig->animalkind = 'seapig'; $elephant->run(); $bird->fly(); $seapig->swim(); ?>
5, select distinct(name) from table_name;
恋上一个人
master
<?php class Animal { public $animal ; private $msg = ''; function __construce ($animal) { $this->animal=$animal; switch($this->animal) { case 'bird': //鸟 $this->fly(); break; case 'elephant': //象 $this->walk(); break; case 'dolphin': //海豚 $this->swim(); break; } } function __destruct() { } private function fly() { $this->halt($this->animal.' can fly'); } private function walk() { $this->halt($this->animal.' can walk'); } private function swim() { $this->halt($this->animal.' can swim'); } private function halt($this->msg) { echo '<pre>'; print_r($this->msg); echo '</pre>'; } } $test=new Animal('bird'); ?>
郁闷的萝卜皮
首席萝卜皮
原帖由 enze 于 2007-9-17 10:11 发表 对第四个回答一下:
<?php class Animal { public $animal ; function __construct ($animal) { $this->animal=$animal; switch($this->animal) { case 'bird': //鸟 $this->fly(); break; case 'elephant': //象 $this->walk(); break; case 'dolphin': //海豚 $this->swim(); break; } } function __destruct() { } private function fly() { $this->halt($this->animal.' can fly'); } private function walk() { $this->halt($this->animal.' can walk'); } private function swim() { $this->halt($this->animal.' can swim'); } private function halt($msg) { echo ''; print_r($msg); echo ''; } } $test=new Animal('bird'); ?>