我修改了下lib_goods.php 报这样的错误。。 谁能帮我看看怎么错的

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

哪位大哥来帮我看看啊。。。。

回答:
有人没?

$sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price,SUM(og.goods_number) as goods_number ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".
"promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, RAND() AS rnd " .
'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g '.
"LEFT JOIN " . $GLOBALS['ecs']->table('order_goods') . " AS og ".
"ON og.goods_id = g.goods_id ".
"LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ";




这是我修改的数据库语句

没人么?????????????????

重建立数据库表就可以了。没什么大问题。注意备份原表数据就OK。

额。。。什么意思????数据库里有这个表啊。。。

把原文件替换回去还会报错吗?

如果不会,那么你修改后保存时注意编码,或是用DW来改。

还有没有人啊。。。。。

那你要说清楚你修改了什么字段内容才出错的,要详细点,要不谁都帮不了你。还原你的操作给我们瞧下

原来是$sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".
"promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, RAND() AS rnd " .
'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' .
"LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ";






我改成
$sql = 'SELECT g.goods_id, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price,SUM(og.goods_number) as goods_number ' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".
"promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, RAND() AS rnd " .
'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g '.
"LEFT JOIN " . $GLOBALS['ecs']->table('order_goods') . " AS og ".
"ON og.goods_id = g.goods_id ".
"LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]' ";

把lib_goods.php文件还原回去就行了,改php文件首先要懂的php才行,不然乱改肯定出错!

额。。。。我想加个库存。。。。原来的里面没有。。
哪位大哥大姐能给我讲下怎么加不?

没人帮帮我么。。。。。

.....终于解决了