-1
<?php
$action = $_POST['insert'];
$info_array = array();
$ItemCode = $_POST['ItemCode'];
$ItemName = $_POST['ItemName'];
$Quantity = $_POST['Quantity'];
$Rate = $_POST['Rate'];
$Total = $_POST['Total'];
echo $SqlPurchdtls = "insert into tblpurcdetails (itemId,itemQty,itemRate,TotalAmt)values
('" . $ItemCode . "','" . $Quantity . "','" . $Rate . "','" . $Total . "')";
$ResultPurchdtls = mysql_query($SqlPurchdtls);
//build the array that will store the item records
$info_array[] = array('idItem' => $idItem, 'ItemName' => $ItemName, 'Quantity' => $Quantity , 'Rate' => $Rate , 'Total' =>$Total);
echo json_encode($info_array); //convert the array to JSON string
?>
在此代碼值不inserted.I創建的數據庫,但沒有價值,以posted.How存儲值的JSON數組中我想插入記錄到數據庫中,但我得到了一個未定義的索引我寫這篇文章的代碼PHP文件
什麼是不確定的索引名和u可以在這裏發佈錯誤。回聲查詢後,直接在phpmyadmin中運行它,看看會發生什麼 – 2014-09-30 12:05:23
$ idItem在哪裏定義/賦值? – kums 2014-09-30 12:05:30