mercredi 19 juillet 2017

Cannot use object of type stdClass as array laravel

I know is simple but i dont know at this moment

In my controller i use

$result = DB::select("SELECT name FROM account_name WHERE name='".$name."'"); 

I can`t get the data out from that array

dd($result) show me:

array:1 [
  0 => {#232
    +"name": "John"
  }
]

How to get that John out????

I have tried $result[0]["name"] but no success and give me that error



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ubHyL9
via IFTTT

Aucun commentaire:

Enregistrer un commentaire