extracting array from PDO fetchall() array
Posted: Sun Oct 02, 2011 4:29 am
Hi,
I am very new to PHP programming and am using PDO to extract data from my database, I currently have a function which returns all rows and columns from a table in my database with a similar code to that shown below,
I then return the result so when I need the data I use,
This bit works fine and I know it works as I have used print_r() to output the entire array, the only problem I have is outputting the data in my desired format. I would like to extract each piece of data from the array individually and have tried using
but with no luck, can anyone think How I could do this ? Thanks,
Paul
I am very new to PHP programming and am using PDO to extract data from my database, I currently have a function which returns all rows and columns from a table in my database with a similar code to that shown below,
Code: Select all
$result = $stmt->fetchAll();Code: Select all
$member_info=MyFunction();Code: Select all
$member_info[x][y]Paul