Zend_Db 枚举值
我找到了这个解决方案
$metadata = $result->getTable()->info('metadata');
echo $metadata['Continent']['DATA_TYPE'];
嗨, 我想获取 Zend_Db 中的枚举值。 我的代码:
$select = $this->select();
$result = $select->fetchAll();
print_r($result->getTable());
输出:
Example Object
(
[_name] => country
[query] => Zend_Db_Table_Select Object
(
[_info:protected] => Array
(
[schema] =>
[name] => country
[cols] => Array
(
[0] => Code
[1] => Continent
)
[primary] => Array
(
[1] => Code
)
[metadata] => Array
(
[Continent] => Array
(
[SCHEMA_NAME] =>
[TABLE_NAME] => country
[COLUMN_NAME] => Continent
[COLUMN_POSITION] => 3
[DATA_TYPE] => enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America')
[DEFAULT] => Asia
[NULLABLE] =>
[LENGTH] =>
[SCALE] =>
[PRECISION] =>
[UNSIGNED] =>
[PRIMARY] =>
[PRIMARY_POSITION] =>
[IDENTITY] =>
)
我在 data_type 中看到枚举值,但没有得到这个值。如何获取data_type?
I find this solution
$metadata = $result->getTable()->info('metadata');
echo $metadata['Continent']['DATA_TYPE'];
Hi,
I want to get enum values in Zend_Db.
My Code:
$select = $this->select();
$result = $select->fetchAll();
print_r($result->getTable());
Output:
Example Object
(
[_name] => country
[query] => Zend_Db_Table_Select Object
(
[_info:protected] => Array
(
[schema] =>
[name] => country
[cols] => Array
(
[0] => Code
[1] => Continent
)
[primary] => Array
(
[1] => Code
)
[metadata] => Array
(
[Continent] => Array
(
[SCHEMA_NAME] =>
[TABLE_NAME] => country
[COLUMN_NAME] => Continent
[COLUMN_POSITION] => 3
[DATA_TYPE] => enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America')
[DEFAULT] => Asia
[NULLABLE] =>
[LENGTH] =>
[SCALE] =>
[PRECISION] =>
[UNSIGNED] =>
[PRIMARY] =>
[PRIMARY_POSITION] =>
[IDENTITY] =>
)
I see enum values in data_type but i don't get this values. How can get data_type?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到这个解决方案
I find this solution