1
$value = $wpdb->get_row("SELECT custom_message FROM `wp_wpsc_cart_contents` WHERE purchaseid='" . $purchase_log['id'] . "'");
如果我這樣做:
print_r($value);
我得到:
stdClass Object
(
[custom_message] => |Castor Seed Oil $4.45|
)
所以我試圖讓該值做:
foreach($value as $index => $result) {
echo $result["custom_message"];
}
我也試過:
foreach($value as $index => $result) {
echo $result->custom_message;
}
但沒有打印任何東西,任何想法我在這裏做錯了什麼?