thinkphp 数据库查询数据
<?php
namespace app\index\controller;
use app\index\model\Daohang;
class Demo6
{
public function get()
{
//dump(Daohang::get(3));
$res = Daohang::field('id,title')->where('id',9)->find();//返回对象
dump($res);
}
public function all()
{
//dump(Daohang::all());
$res = Daohang::field('id,title')->where('id','in','1,2,3')->select();
dump($res);
}
}
php知识网
浙公网安备 33010602011771号