PHP bulk insert foreach

前端 未结 4 1186
一整个雨季
一整个雨季 2021-01-03 05:54

I have a curl script which reads the data from a remote source. Below is the current code:

function download_page($path){
    $ch = curl_init();
    curl_set         


        
4条回答
  •  时光说笑
    2021-01-03 06:36

    You can insert all records at once as below: Like when we export data from mysql table.

    INSERT INTO tablename (id, field2, field3, field3) VALUES ('', 5454, '454', '545'), ('', 'erwe', 'rewrew', 'werew'), ('', 'ewrew', 'rwerwe', 'werwer'), ('', 'jkj', 'ere', 'uju') , ('', '343', '3434', 'dfdf');
    

提交回复
热议问题