gpt4 book ai didi

php - 在php中连接mysql的两个字段

转载 作者:行者123 更新时间:2023-11-29 05:38:13 25 4
gpt4 key购买 nike

我在 mysql 数据库表帽中有 imgpathimgname 字段。我的图片路径是images/man/caps/,图片名称是sun-cap.png。现在我想通过这个查询来选择它们

select imgpath, imgname from caps;

现在如何连接它们并在 php 中显示它,这样输出可能是这样的

images/man/caps/sun.cap.png

最佳答案

select concat(imgpath, imgname) as img from caps;

关于php - 在php中连接mysql的两个字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8937754/

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