assign value from fetch array
| From: | ICCSI | Date: | Mon, 19 May 2014 23:57:51 +0000 |
| Subject: | assign value from fetch array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-323347@lists.php.net to get a copy of this message | ||
I have following code to fetch data from database.
I am able to print the array, but I got HTTP 500 error when I assign the
array the value to echo the result.
I think I am missing something between array and variable.
Your help and information is great appreciated,
Iccsi,
$row = $sth->fetchAll(PDO::FETCH_ASSOC);
print_r($row);
print("\n");
$name = "{$row['MyID']}";
echo $name;