mysql concat blob,mySQL groupconcat返回BLOB xxxB / Kib

On advice from a member and a previous post I'm running a query against multiple tables on an interspire shopping cart database that looks like this:

SELECT c.customerid, c.custconfirstname, c.custconemail, o.ordstatus, o.orddate, GROUP_CONCAT( 'Order Id: ', orderid, ' | Product name: ', ordprodname, ' | Quantity: ', ordprodqty, '
' ) AS ordered_items

FROM isc_customers c

LEFT OUTER JOIN isc_orders o ON o.ordcustid = c.customerid

LEFT OUTER JOIN isc_order_products op ON op.orderorderid = o.orderid

LEFT OUTER JOIN isc_product_images pi ON pi.imageprodid = op.orderprodid

GROUP BY c.customerid

HAVING COUNT( DISTINCT o.ordcustid ) >0

AND o.ordstatus = 0

AND o.orddate < UNIX_TIMESTAMP( ) - '18000'

AND o.orddate > UNIX_TIMESTAMP( ) - '259200'

The result I'm getting in phpmyadmin looks like this:

customerid custconfirstname custconemail ordstatus orddate ordered_items

6532 Cust1 CUST1@EXAMPLE.COM 0 1337502962 [BLOB - 498B]

5522 Cust2 CUST2@EXAMPLE.COM 0 1337670453 [BLOB - 284B]

4321 Cust3 CUST3@EXAMPLE.COM 0 1337507476 [BLOB - 521B]

1235 Cust4 CUST4@EXAMPLE.COM 0 1337577095 [BLOB - 1.0 KiB]

9560 Cust5 CUST5@EXAMPLE.COM 0 1337518452 [BLOB - 1.0 KiB]

When I try to echo the result in a php page to test it, nothing is returning. I'm just wondering what the Blob means and how to use it. It's obvious it's got some data in it, I just don't know how to access it or use it.

解决方案

In phpmyadmin above the values displaying you can see the +Options button Click on that then check the Show BLOB contents and click Go button.it will display the values.

You can use the ordered_items in the similar way how you are accessing the customerid.

in php

foreach($resultSet as $row)

{

$customerid = $row['customerid'];

$ordered_items = $row['ordered_items'];

}

The variable $ordered_items contains the values as it is displayed in phpmyadmin.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值