Ray Hunter wrote:
$fooVar = mysql_fetch_assoc($result)["barColumn"];
No bug here...mysql_fetch_assoc($result) is a function that takes a
result set as an argument and returns only one row as an associated
array...that is why you need to do
Thanks for the quick response, but I am not sure I understand your argument. Yes, I am aware that the function returns an array corresponding to a single row/record; what I don't understand is why I am not able to apply a key directly to that "temporary" return value. In other words, it is necessary to "copy" the resulting row into a new variable so that it is then possible to use the column name (key) to retrieve the desired value.
Use mysql_result() if you want to fetch a single column directly.
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php