作者:mobiledu2502927723 | 来源:互联网 | 2018-04-24 02:28
"$ccfile_get_contents('dataphone_log.txt');$arrContsexplode("n",$cc);foreach($arrContsas$ccc){$cccjson_decode(stripslashes($ccc),true);...处理json插入数据库}"mysql表的id是自增的,没有插入$query"INSERTINTOlogsSET
mysqlphpforeach
$cc = file_get_contents('data/phone_log.txt');$arrCOnts= explode("\n",$cc);foreach($arrConts as $ccc){$ccc = json_decode(stripslashes($ccc), true);...处理json插入数据库}
mysql表的id是自增的,没有插入
$query = "INSERT INTO logs SET name='".$ccc[name]."',state=1,domain='".$domain."',data='".$new."'";
mysql_query($query);
打开文本获得json数组,然后处理,但是多行的时候每次只插入第一个数据