【发布时间】:2012-06-18 18:17:03
【问题描述】:
我有下一个 mysql 查询:
$productn = $jdb->query('SELECT t2.title FROM '.DB_PREFIX.'shopping_cart AS t1 LEFT JOIN '.DB_PREFIX.'shop_order_details AS t2 ON t1.shopid WHERE t1.session = "'.smartsql($_SESSION['shopping_cart']).'"');
while ($rowp = $productn->fetch_assoc()) {
// my product title
$productname = $rowp["title"];
}
使用 print_r($productname);我得到了类似的东西:
姓名1姓名1姓名1姓名2姓名2
我想显示如下内容:
3 x 名称1 2 x 名称2
或
3 x 名称1,2 x 名称2
这个可以吗?
【问题讨论】:
-
有可能,但是what have you tried?
标签: php mysql function printing count