Ich versuche, mehr als 100 Zeilen in PostgreSQL-Datenbank mit PHP in einer Schleife einfügen. Ich bekomme keine Fehler.mehr als 100 Zeilen nicht Einfügen in Postgresql mit PHP durch Formular
Die Daten werden eingefügt, wenn ich versuche, 50 bis 60 Datensätze hinzuzufügen. Wenn die Datensätze jedoch um 100 und darüber liegen, wird sie nicht eingefügt.
Unten ist der Code, den ich ausprobiert habe. Bitte gehen Sie durch und helfen Sie mir bei der Lösung dieses Problems.
Vielen Dank im Voraus.
<?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>';
} }
}
}
?>
Code anzeigen. Wie benutzt man PostgreSQL? PDO oder pg_ *? – Michas
Ich benutze postgreSQL pg_ *. –
Verwenden Sie 'pg_last_error()' http://php.net/manual/en/function.pg-last-error.php, um weitere Details zu erhalten. – Michas