回复详情

admin

2016-8-15 0

补充一下

引擎用的是 PDO 所以你使用query方法 会返回对象 并不会返回查询结果

http://php.net/manual/zh/class.pdostatement.php

比如你现在要的 多表查询

$data = S("Plugin")->query("select hy_thread.title from hy_thread,hy_post where hy_thread.id=hy_post.tid and (hy_thread.title like '%a%' or hy_post.content like '%a%')")->fetchAll(\PDO::FETCH_ASSOC); //注意后面的->fetchAll(\PDO::FETCH_ASSOC);

//print_r $data; 

->fetchAll(\PDO::FETCH_ASSOC);


加载更多

登陆后才可发表内容