Php 无法更新推进中的主键字段值
我正在尝试更新作为主键字段的行项目的字段值。表结构如下Php 无法更新推进中的主键字段值,php,mysql,propel,Php,Mysql,Propel,我正在尝试更新作为主键字段的行项目的字段值。表结构如下 mysql> desc sms_service_settings; +-----------------------------+------------------------------+------+-----+-----------+-------+ | Field | Type | Null | Key | Default +--
mysql> desc sms_service_settings;
+-----------------------------+------------------------------+------+-----+-----------+-------+
| Field | Type | Null | Key | Default
+-----------------------------+------------------------------+------+-----+--------
| customer_id | int(11) unsigned | NO | PRI | NULL
| daily_limit | decimal(8,2) | YES | | NULL
| account_type | enum('Post-paid','Pre-paid') | NO | | Post-paid
| credit_amount | double(8,4) | YES | | NULL
+-----------------------------+------------------------------+------+-----+--------
$sms_service = SmsServiceSettingsQuery::create()
->findPK($original_customer_id);
$sms_service->setCustomerId($new_customer_id);
$sms_service->save();
表的模式定义如下
<table name="sms_service_settings" idMethod="native" phpName="SmsServiceSettings">
<column name="customer_id" phpName="CustomerId" type="BIGINT" primaryKey="true" required="true" defaultValue="0"/>
<column name="daily_limit" phpName="DailyLimit" type="DECIMAL" size="8" scale="2"/>
<column name="account_type" phpName="AccountType" type="VARCHAR" sqlType="enum('Post-paid','Pre-paid')" size="15" defaultValue="Post-paid"/>
<vendor type="mysql">
<parameter name="Engine" value="MyISAM"/>
</vendor>
</table>
这不会返回任何错误。但客户id未更新。请有人帮忙。检查它是否被另一个表作为外键引用。另外,如果您向我们展示整个SQL查询
$new\u customer\u id
可能存在于另一个数据库中,这将非常有帮助row@MisirJafarov否。表中不存在新的客户id。@Arkoudinos表中的此字段没有任何外键关系。@GayanFernando您能用mysqli\u error()
(或使用pdo)?