Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP中的字符串大小溢出_Php - Fatal编程技术网

PHP中的字符串大小溢出

PHP中的字符串大小溢出,php,Php,错误代码: 字符串大小溢出 代码: mysql\u connect($servername、$username、$password)或die(mysql\u error()); mysql\u select\u db($dbname); $sql=“插入EM(sourceindex、targetindex、source、target)值”; 对于($i=0;$i通过在循环中执行插入代码逐个插入数据,并延长文件的最大执行时间。 对于($i=0;$iString size溢出代码您有一个大于2GB的

错误代码: 字符串大小溢出 代码:

mysql\u connect($servername、$username、$password)或die(mysql\u error());
mysql\u select\u db($dbname);
$sql=“插入EM(sourceindex、targetindex、source、target)值”;
对于($i=0;$i
通过在循环中执行插入代码逐个插入数据,并延长文件的最大执行时间。

对于($i=0;$iString size溢出代码您有一个大于2GB的字符串?!您想做什么?我想您想在insert查询中进行一些拆分,这样就不会超过2GB的字符串?!嗯,也许运行+/-50万个查询可能需要一段时间,OP可以简单地将其拆分为一组,例如100组,或者如此抱歉,我无法理解您现在解释一下为什么OP的方法不起作用就好了。
     mysql_connect($servername,$username,$password) or die(mysql_error());
mysql_select_db($dbname);

$sql= "INSERT INTO EM (sourceindex, targetindex,source,target) VALUES ";

for($i=0;$i<$combine_arr_size;$i++){
   for($j=0;$j<$combine_arr_size;$j++){
   $sql.="('$i','$j','$combine_words_array[$i]','$combine_words_array[$j]'),";
 }
}
mysql_query(substr($sql,0,-1));
Insert data one by one by executing insertion code in loop, and extend maximum execution time of file.

for($i=0;$i<$combine_arr_size;$i++){
   for($j=0;$j<$combine_arr_size;$j++){
   $sql="INSERT INTO EM (sourceindex, targetindex,source,target) VALUES ('$i','$j','$combine_words_array[$i]','$combine_words_array[$j]')";
 mysql_query($sql);
}
}