Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用PostgreSQL';拉雷维尔的弦乐是否雄辩?_Php_Laravel_Laravel 5.1 - Fatal编程技术网

Php 如何使用PostgreSQL';拉雷维尔的弦乐是否雄辩?

Php 如何使用PostgreSQL';拉雷维尔的弦乐是否雄辩?,php,laravel,laravel-5.1,Php,Laravel,Laravel 5.1,当我尝试使用时,它被视为字符串而不是函数: ->选择(['string\u agg(file\u name,,')作为file\u names'])如果您有连接: ->select(DB::raw("string_agg(file_name.something,',') as file_names")) 另一种情况是: ->select(DB::raw("string_agg(file_name,',') as file_names")) 您正在查找->选择(DB::raw('s

当我尝试使用时,它被视为字符串而不是函数:

->选择(['string\u agg(file\u name,,')作为file\u names'])

如果您有连接:

->select(DB::raw("string_agg(file_name.something,',') as file_names"))
另一种情况是:

->select(DB::raw("string_agg(file_name,',') as file_names"))

您正在查找
->选择(DB::raw('string_agg(file_name,,')作为file_name'))
@Uchiha这就是我要尝试的。它说
App/Db
notfoundsimply-use
use-Db我认为你不需要知道在哪里写it@Uchiha它不适用于多个列。选中此选项:```->select(\DB::raw('posts.*',string_agg(attachments.file_name',','),project_types.name作为project_type_name'))````它应该像
->select('posts.*',DB::raw('string_agg(attachments.file_name','),'),'project_types.name作为project_type_name')