mysql-foreach语句怎么就插入第一个数据

WBOY
Release: 2016-06-02 11:28:30
Original
1385 people have browsed it

mysqlphpforeach

<code> $cc = file_get_contents('data/phone_log.txt');$arrConts = explode("\n",$cc);foreach($arrConts as $ccc){$ccc = json_decode(stripslashes($ccc), true);...处理json插入数据库}</code>
Copy after login

mysql表的id是自增的,没有插入
$query = "INSERT INTO logs SET name='".$ccc[name]."',state=1,domain='".$domain."',data='".$new."'";
mysql_query($query);

<code> 打开文本获得json数组,然后处理,但是多行的时候每次只插入第一个数据</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!