PHPをループで使用して100を超える行をpostgresqlデータベースに挿入しようとしています。私は何の誤りもありません。php throughtを使用してpostgresqlに100行以上挿入していない
約50から60レコードを追加しようとすると、データが挿入されています。レコードが100周年以上になると挿入されません。
以下は試したコードです。この問題を解決してください。
ありがとうございます。
<?php
$userid = $_SESSION['user_id'];
$array ='';
$resultAgain ='';
if (isset($_POST['save'])) {
// $sponsorship_id = $_POST['sponsorid'];
$resultAgain=array();
$resultAgain = $_SESSION['arr_rows'];
for ($i = 0; $i <count($resultAgain); ++$i) {
$recieptid = $resultAgain[$i]['recieptid'];
$childid = $resultAgain[$i]['childid'];
$openingbalance_fee = $resultAgain[$i]['openingbalance_fee'];
$openingbalance_familyhelp = $resultAgain[$i]['openingbalance_familyhelp'];
$mayreciept = $resultAgain[$i]['mayreciept'];
$december_reciept = $_POST['decreciept'.$resultAgain[$i]['presentclass']];
$adminfees = $_POST['adminfees'.$resultAgain[$i]['presentclass']];
$schoolfee = $_POST['schoolfee'.$resultAgain[$i]['presentclass']];
$familyhelp = $resultAgain[$i]['family_help'];
$year = $_POST['yearName'];
$submit = $_POST['save'];
// call insert function
$sql1="SELECT fn_reciept_insert($childid,
'$openingbalance_fee',
'$openingbalance_familyhelp',
'$mayreciept',
'$december_reciept',
'$adminfees',
'$familyhelp',
'$schoolfee',
'$year',
$userid,
localtimestamp,
$userid,
localtimestamp)";
$result1 = pg_query($dbconn,$sql1);
if (!$result1) {
echo '<script>alertMX("Data Not Updated")</script>';
}
else
{
echo '<script>alertMX("Data inserted Successfully")</script>';
} }
}
}
?>
いくつかのコードを表示します。 PostgreSQLの使い方PDOまたはpg_ *? – Michas
私はpostgreSQLのpg_ *を使用しています。 –
詳細は、 'pg_last_error()'を参照してください。http://php.net/manual/en/function.pg-last-error.php – Michas