php in laravel ,what is wrong with my mysql statement?

$res = DB::connection('mysql_business')->table('t_activity')
            ->select('SELECT app_id,title ,created_at,id
                FROM t_activity
                WHERE created_at > ? ORDER BY created_at DESC', [ '2018-04-01 20:11:12']);

var_dump($res);//print some database.php information  囧

print many strings like this
object(IlluminateDatabaseQueryBuilder)#68 (22) {
["connection"]=>
object(IlluminateDatabaseMySqlConnection)#58 (16) {

["pdo":protected]=>
object(Closure)#57 (2) {
  ["static"]=>
  array(1) {
    ["config"]=>
    array(12) {
      ["driver"]=>
      string(5) "mysql"
      ["port"]=>
      string(4) ""************************""
      ["database"]=>
      string(14) "************************"
      ["username"]=>
      string(4) "root"
      ["password"]=>
      string(12) ""************************""
      ["charset"]=>
      string(4) "utf8"
      ["collation"]=>
      string(15) ""************************""
      ["prefix"]=>
      string(0) ""
      ["strict"]=>
      bool(false)
      ["engine"]=>
      NULL
      ["name"]=>
      string(14) ""************************""
      ["host"]=>
      string(33) ""************************""
    }

it just print information in database.php , not the answer I want, why??

and below code is it right

$ret = DB::connection('mysql_business')->table('t_activity')->where('created_at', '>', '2018-04-01 20:11:12')
            ->select('app_id', 'title', 'created_at', 'id')->get();
阅读 915
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题