如何修改message.php能把留言本相应留言对应的商品图片也调出来啊

2016-07-07 16:07 来源:www.chinab4c.com 作者:ecshop专家

只加这句是不行的,因为SQL语句中根本没取出goods_thumb ,
况且你加的那句也是错误百出的。
完整的写法
if($rows['id_value'])
{
$sql_goods = "SELECT goods_name,goods_thumb FROM ".$GLOBALS['ecs']->table('goods');
$sql_goods .= "WHERE goods_id= ".$rows['id_value'];
$goods_res = $GLOBALS['db']->getRow($sql_goods);
$msg[$rows['msg_time']]['goods_name'] = $goods_res['goods_name'];
$msg[$rows['msg_time']]['goods_url'] = build_uri('goods', array('gid' => $rows['id_value']), $goods_res['goods_name']);
$msg[$rows['msg_time']]['goods_thumb'] = get_image_path($rows['id_value'], $goods_res['goods_thumb'], true);
}