我有一个奇怪的现象。我将数据库表添加到架构中,这些架构已经存在于数据库连接'virtuemart'中。但他无法连接到这个表格。
我用
尝试了 $taxId = Doctrine::getTable('JosVmTaxRate')
->findOneBy('tr.tax_country', 'NZL');
和
$taxId = Doctrine::getTable('JosVmTaxRate')
->findBy('tr.tax_country', 'NZL');
和
$taxId = Doctrine::getTable('JosVmTaxRate')
->findOneBy('tr.tax_country', '"NZL"');
和
$taxId = Doctrine::getTable('JosVmTaxRate')
->createQuery('tr')
->addWhere('tr.tax_country =?', 'NZL')
->execute()
->get(0);
但始终是错误消息
500 | Internal Server Error | Doctrine_Transaction_Exception
Rollback failed. There is no active transaction.
出现
我检查了架构,但我找不到任何错误:
JosVmTaxRate:
columns:
tax_rate_id: { type: int, notnull: true, unique: true, primary: true, autoincrement: true }
vendor_id { type: int, default: null }
tax_state { type: string(64), default: null }
tax_country { type: string(64), default: null }
mdate { type: int, default: null }
tax_rate { type: decimal(10), scale(4), default: null }
有什么想法吗?
我希望我提供了足够的信息。如果不是,请不要犹豫,并要求它。
答案 0 :(得分:2)
代码看起来不错,但架构没有。
vendor_id
,tax_state
,tax_country
,mdate
和tax_rate
之后的冒号怎么样?他们失踪了。
scale(4)
错了。 scale: 4
是正确的。