Hey guys im having a little trouble with the PDO in php as the error it is returning is an undefined index. The code for the function and query and return of result is this:
fetchAll returns all results (potentially multiple rows) in a multidimensional array:
fetchAll
array( 0 => array(/* first row */), 1 => array(/* second row */), ... )
That's why the array doesn't have a direct index 'name', it needs to be [0]['name']. Or you shouldn't fetchAll, just fetch.
'name'
[0]['name']
fetch