I am trying to insert excel sheet data into mysql database. First, I convert that file into comma delimited CSV and then apply this code.
My purpose isPHP Code:
$link = mysql_connect("localhost", "user", "pass");
$file = $_FILES['excel_file']['name'];
$query = 'LOAD DATA INFILE /www/trisha/admin/"'.$file.'" INTO TABLE student_info FIELDS TERMINATED BY "," LINES TERMINATED BY "\\r\\n";';
1; upload csv file
2; run load command and insert that file data into DB
2; remove that uploaded file
Please advise what I am doing mistake.