Posted by roger on 09/27/01 11:38
I know I'm over looking something simple, so maybe somene here can help
me out.
I'm unsuccessfully trying to dereference an element of an array. I'm
trying to get the name of a PDO database column.
$rows->getColumnMeta($recNumber) will return an array with all my db
col details.
array(6) {
["name"]=>
string(2) "id"
["len"]=>
int(11)
["precision"]=>
int(0)
["pdo_type"]=>
int(2)
}
....
....
I want to be able to get the column name (name=>id) in element in 1
statement: Something like:
print "name = : " . $rows->getColumnMeta($recNumber)['name'] . " \n";
But this does not work.
Instead I've been forced to use the much less elegant:
$tmp = $rows->getColumnMeta($recNumber);
$colName = $tmp['name'];
This works but I know that there is a better way of doing this.
Any suggestions would be appreciated.
Thanks,
Roger
Navigation:
[Reply to this message]
|