mysql数据库表大写中的字段是imgpath和imgname。我的图像路径是images/man/caps/,图像名是sun-cap.png。现在,我想通过这个查询来选择他们两个
select imgpath, imgname from caps;现在,如何将它们连接起来,并将其显示在php中,以便输出如下所示
图像/man/caps/Sun.cap.ng
发布于 2012-01-20 07:09:19
把它当作
$result = mysql_query('select concat(imgpath, imgname) as img from caps');
while ($row = mysql_fetch_assoc($result)){
echo $row['img'];
}发布于 2012-01-20 06:52:58
select concat(imgpath, imgname) as img from caps;发布于 2012-01-20 06:53:11
就像这样:
select concat(imgpath, imgname) from caps;https://stackoverflow.com/questions/8937754
复制相似问题