gpt4 book ai didi

php - 如何查看相册中的图片

转载 作者:行者123 更新时间:2023-11-29 20:06:16 24 4
gpt4 key购买 nike

我有 3 个表图像、相册和 murs,我想根据 murs_id(即 murs 的 id)的引用来查看每个相册的图像。

图片:ID专辑ID图片

专辑:ID姓名图像murs_id

穆尔:ID滴度

$grids = DB::table('images')
->select(['image']);
$grids->join('albums','images.albums_id','=','albums.id');
$grids->where('albums.murs_id','=','12');
$grids= $grids->get();

I get this error message : Cannot use object of type stdClass as array.

print_r($网格)

Array ( [0] => stdClass Object ( [image] => af6a8ce73d995a028422293bdc23774e.png ) 
[1] => stdClass Object ( [image] => 00204bc5330c4f6b84028d23b6e96c09.png )
[2] => stdClass Object ( [image] => b474b62ca932066ee5ac77094c757e74.png )
[3] => stdClass Object ( [image] => 2c24b205b24bb1b47da90c54e2babfdb.png )
[4] => stdClass Object ( [image] => 2d4b78b29ee5abbe103eed7b6b42cbdb.png )
[5] => stdClass Object ( [image] => 6041a1abb83b18d38918fe9c79309596.jpg )
)

最佳答案

试试这个:

$grids = DB::table('images')
->select('images.image')
->join('albums','images.albums_id','=','albums.id')
->where('albums.murs_id','=','12')
->get();

关于php - 如何查看相册中的图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40339090/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com