ich Laravel Framework 5.5.26
verwende und ich mit dem folgenden Aufruf meine db bin Abfrage:Laravel 5.5 - Parse Ergebnis db Abfrage
$symbolsArray = DB::table('exchanges')
->join('markets', 'exchanges.id', '=', 'markets.exchanges_id')
->where('name', $exchangeName)
->get(array(
'symbol',
));
Wenn ich var_dump($symbolsArray)
erhalte ich folgende Ausgabe:
class Illuminate\Support\Collection#619 (1) {
protected $items =>
array(99) {
[0] =>
class stdClass#626 (1) {
public $symbol =>
string(7) "BCN/BTC"
}
[1] =>
class stdClass#621 (1) {
public $symbol =>
string(8) "BELA/BTC"
}
[2] =>
class stdClass#623 (1) {
public $symbol =>
string(7) "BLK/BTC"
}
[3] =>
class stdClass#627 (1) {
public $symbol =>
string(8) "BTCD/BTC"
}
...
}
}
I Ich versuche, die $symbol
wie folgt zu erhalten:
$symbolsArray[$key]['symbol']
Allerdings bekomme ich folgende Fehlermeldung:
Cannot use object of type stdClass as array
Irgendwelche Vorschläge, wie die symbol
von der Abfrageausgabe zugreifen?