I get array result of a native query in Doctrine. The query is
$conn = $em->getConnection();
$sql = 'SELECT * FROM Stock_drink d WHERE id=?';
$stmt = $conn->prepare($sql);
$stmt->bindValue(1,$idstockdrink);
$stmt->execute();
$stockdrink = $stmt->fetchAll();
The $stockdrink content is
"{"stockdrink":[{"id":"39","name":"limon","stockamount":"14","price":"2.20","Drink_id":"5","Bar_id":"12"}]}"
And now i want to get some values of $stockdrink array with these sentences but always get the notice undefined index. I was looking de docs and i haven't seen the solution.
$iddrink = $stockdrink["name"];
$name = $stockdrink["name"];
$price = $stockdrink["price"];
Thanks in advance!!!!