Sid Sid - 9 months ago 35
MySQL Question

How to get object's values from object in php?

I am selecting one column from Member table. Now I want to get the value from this column. But when I try to get the value I am getting an exception as :

<br />
<b>Notice</b>: Trying to get property of non-object in
<b>C:\Program Files (x86)\Ampps\www\MLMapi\PurchaseProduct.php</b> on line
<br />


$stmt = $dbConnection->prepare("select Member.sales_hold_fund from Member where member_id=?");
$member = $stmt->fetch(PDO::FETCH_ASSOC);

$fund = $member-> sales_hold_fund;// line54

$sales_hold_fund = $fund + $amount;

I want to get the sales_hold_fund value from database and add the amount value to the sales_hold_fund.

member value :

"Member": {
"sales_hold_fund": "1000"

Can anyone help please? Thank you..



 $fund = $member['sales_hold_fund'];