use Think\Model; $ret = $Model->query("select * from think_user where score >= " . $score);
use Think\Model;
//http://localhost/thinkphp323/index.php/home/User/query_score/score/20 public function query_score($score=60){ $Model = new \Think\Model(); // 实例化一个model对象 没有对应任何数据表 $ret = $Model->query("select * from think_user where score >= " . $score); var_dump($ret); }
array (size=3) 0 => array (size=4) 'id' => string '1' (length=1) 'username' => string 'jim' (length=3) 'score' => string '100' (length=3) 'create_time' => string '0' (length=1) 1 => array (size=4) 'id' => string '2' (length=1) 'username' => string 'tom' (length=3) 'score' => string '100' (length=3) 'create_time' => string '0' (length=1) 2 => array (size=4) 'id' => string '3' (length=1) 'username' => string 'lucy' (length=4) 'score' => string '23' (length=2) 'create_time' => string '0' (length=1)

 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号