我试图将数据插入数据库,但总是出错
$insertTransaction = $odb->prepare("INSERT INTO `cq9_transactions` VALUES(NULL, :userId, :actionType, :account, :createTime, :endTime, :statusTxt, :statusMessage, :beforeBalance, :afterbalance, :currencyCode, :eventJSON, :createdAt, NULL)");
$insertTransaction->execute(array(':userId' => 1, ':actionType' => 'takeall', ':account' => 'admin', ':createTime' => getDateTime(), ':endTime' => getDateTime(), ':statusTxt' => 'success', ':statusMessage' => 'success', ':beforeBalance' => '1', ':afterBalance' => '1', ':currencyCode' => 'CNY', ':eventJSON' => '1', ':createdAt' => serverDateTime()));
错误消息:警告:pdostatement::execute():sqlstate[hy093]:无效参数号:第120行的c:\xampp\htdocs\cq9 api\public\index.php中未定义参数
1条答案
按热度按时间kb5ga3dv1#
您正试图向表中插入14个值,但只执行了12个值。尝试修改execute()或insert语句。