为什么我的 php Insert 语句只在 phpMyAdmin 中插入了 74 个项目


Why is my php Insert statement only inserting 74 items into phpMyAdmin?

我最近尝试将100多个项目插入到phpMyAdmin数据库表中。但是,在成功插入 74 行后,它停止将项目正确插入数据库,而是只插入空白行或我想要的一半信息。

我检查了代码,回显了位,在phpMyAdmin中测试了查询,并检查了可能导致任何问题的任何特殊字符,但是没有错误。

我决定将数据作为两个单独的集合插入,即插入 74 行,删除我不需要的内容,然后重新插入剩余的 50 行,所有正确插入的内容。

这是第三次发生,只是想知道这是否是phpMyAdmin的已知错误,或者在插入超过74行时是否需要更改代码。

插入件包裹在 foreach 循环中,插入件如下所示

$insertorderreference ="插入check_order_reference 值 (''','$order_id','$order_item_id'、'$s'、'$newsku'、'$size'、'$quantity'、'、'$product_name'、'$product_id'、'$site_name'、'$first_order'、'$last_order'、'$supplier_name'、'$date'(;"; 呼应$insertorderreference。

'; mysql_query($insertorderreference、$connection(;

------------------------------------------更新----------------------------------这就是我运行插入时发生的情况(这是出现问题的地方(

插入check_order_reference值(","87","172","80","447430-739","S","1","172","粉底T恤","1692","GLAS","86","104","耐克","09/10/2013/13/18"(;

插入check_order_reference值(","98","195","80","447431-010","L",","耐克长针织短裤 - 黑色","1660","GLAS","86","耐克","09/10/2013/13/18"(;

插入check_order_reference值(",","187","80",","179","耐克","09/10/2013/13/18"(;

插入check_order_reference值(",","178",","耐克","09/10/2013/13/18"(;

please try like below way
<?php
$con=mysqli_connect('localhost','root','','db') or die(mysqli_error());
//place your host,user,pass,db details
$name='mahendra';
// get here post or other values ex- $_POST['name']
$data='sdfsdfsdf';
// $_POST['data'] if script is running on submit button of form
for($i=1;$i<=100;$i++){
$q="insert into mydemo set id='',name='".$name."',data='".$data."'";
//place your table name instead of mydemo and change insert query
$q=mysqli_query($con,$q);
}
//please check the your data for duplication of primary key value etc because of that your //script not inserting all records
?>