Array ( [0] => Array ( [SubID] => 19 [0] => 19 [RandomCode] =>
P57bz0y24DdKofbI6M4BqJfDs0QNtL2XpBANnzys [1] =>
P57bz0y24DdKofbI6M4BqJfDs0QNtL2XpBANnzys [Email] => as@sasa.com [2] =>
as@sasa.com [CreateDate] => 2012-03-25 [3] => 2012-03-25 [UpdateDate]
=> 0000-00-00 [4] => 0000-00-00 [27_t1] => [5] => [31_asas] => 0 [6] => 0 ) )
The result is like this now but i can not get it by
echo $result['Email'];
Why is the error? Thank you
not good!
the list of columns you’re selecting shouldn’t be a bind variable, because (as a string value) it will then be enclosed in quotes rather than backticks. MySQL will then treat it as a simple quoted string, and return that quoted string (‘Email’) rather than the actual column you want for each record that it returns.
Don’t bind the column name. Use SELECT *, just the one bind variable for the SubID value in your WHERE clause.
When you’ve done fetchAll(), then walk the result extracting the column that you want.