-1
我知道這是很多要求得到非對象的屬性,但我有這樣的代碼:嘗試所有,雖然它確實存在
foreach($prices as $price){
$provider_id = $price->provider_id;
$prod_id = $price->product_id;
$name = $price->prod_name;
$desc = $price->desc;
$price = $price->price;
$original_price = $price->original_price;
$reward = $price->reward;
}
現在,如果我print_r
我得到它:
stdClass Object
(
[id] => 1214
[price_list_id] => 123
[product_id] => 136
[provider_id] => 1
[price] => 0
[reward] => 0
[original_price] => 135
[prod_name] => some text
[desc] => some text with ' and " and ,
)
任何想法可能導致這種情況?我得到的錯誤上original_price
和reward
有什麼錯誤? –
你傳遞給'print_r()'什麼變量? – nickb
@ coder1984「試圖獲得非對象的財產」和尼克我傳球$價格 –