我在$PYParentID
上遇到以下代码的问题。当我执行我的帖子操作时,我总会得到未定义的变量错误。我错过了什么吗?
错误消息
未定义的变量:PYParentID loc:C:\ xampp \ htdocs \ kawaguchi \ apps \ modules \ Account \ controllers \ D ownPaymentAp.php line:301
$this->db->insert(T_AccountPayableHeader, $PYHeader);
//print_r($PYParentID);die;
$PYParentID = $this->db->insert_id();
$detailPayment = $detail->first_row("array");
$payableID = $vendor->first_row("array");
$PYDetail = array(
T_AccountPayableDetail_RecordStatus => "",
T_AccountPayableDetail_RecordUpdatedOn => date('Y-m-d g:i:s',now()),
T_AccountPayableDetail_RecordUpdatedBy => $this->ezrbac->getCurrentUserID(),
T_AccountPayableDetail_RecordUpdatedAt => $this->input->ip_address(),
T_AccountPayableDetail_PRI => $PYParentID,
T_AccountPayableDetail_DocTypeID => $headerData[T_MasterDataDownPayment_DocName],
T_AccountPayableDetail_DocNo => $headerData[T_MasterDataDownPayment_DocNo],
T_AccountPayableDetail_DocDate => $headerData[T_MasterDataDownPayment_DocDate],
T_AccountPayableDetail_DueDate => "",
T_AccountPayableDetail_DaysOverdue => "",
T_AccountPayableDetail_InvoiceAmount => $headerData[T_MasterDataDownPayment_Amount],
T_AccountPayableDetail_AmountPaid => $headerData[T_MasterDataDownPayment_TotalAmount],
T_AccountPayableDetail_AmountOutstanding => "",
T_AccountPayableDetail_Bank => $headerData[T_MasterDataDownPayment_BankAccountNo],
T_AccountPayableDetail_SchedulePayment => "",
T_AccountPayableDetail_PONo => $detailPayment[T_MasterDataDownPaymentDetail_PoNo],
);