Reply to perl -> php PDO newbie question

Your name:

Reply:


Posted by roger on 10/14/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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация