Search
 
SCRIPT & CODE EXAMPLE
 

PHP

import data from csv to db php

<?php
$query = <<<eof
    LOAD DATA INFILE '$fileName'
     INTO TABLE tableName
     FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"'
     LINES TERMINATED BY '
'
     IGNORE 1 LINES
    (field1,field2,field3,etc)
eof;

$db->query($query);
?>
Comment

PREVIOUS NEXT
Code Example
Php :: Get All dates of a month with laravel carbon 
Php :: The specified module could not be found php 
Php :: wp_query first post 
Php :: fillable vs guarded laravel 
Php :: laravel belongs to 
Php :: woocommerce_variation_option_name on frontend 
Php :: preg_split in php 
Php :: -store() laravel change name 
Php :: PHP join() Function 
Php :: convert collection to array laravel 
Php :: where like in laravel 
Php :: remove last 3 character from string php 
Php :: laravel eloquent get one column value 
Php :: laravel array search blade 
Php :: how to know if file is empty in php 
Php :: php get html with special characters 
Php :: laravel pagination limit page 
Php :: spatie activity log 
Php :: laravel valet subdomain 
Php :: how to check if query is successfully inserted laravel 
Php :: php refresh page without reloading 
Php :: sms laravel 
Php :: get all taxonomy name wordpress 
Php :: license_verify 
Php :: laravel looping checking if last record has reached 
Php :: best custom email validation rule for laravel 
Php :: italic text in laravel notification 
Php :: Call to undefined method PsyUtilStr::random() 
Php :: conditional validation laravel based on role 
Php :: validate file count with validate in laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =