I have a table data in my excel file,
How can i generate mysql insert queries from excel data?
Is there any solution to import data from excel to mysql?
Yes, you can generate the mysql queries from excel using PHP.
error_reporting(E_ALL ^ E_NOTICE);
require_once 'query_generator.php';
$data = new Spreadsheet_Excel_Reader("example.xls");
Output:
INSERT INTO table_name VALUES ( '101', 'Narendra Modi', 'Cabinet Ministers', 'Personnel, Public Grievances and Pensions, Department of Atomic Energy, Department of Space, All important policy issues and all other portfolios not allocated to any Minister', 'NULL', 'NULL', 'NULL');
INSERT INTO table_name VALUES ( '102', 'Rajnath Singh', 'Cabinet Ministers', 'Home Affairs', 'NULL', 'NULL', 'NULL');
INSERT INTO table_name VALUES ( '103', 'Sushma Swaraj', 'Cabinet Ministers', 'External Affairs, Overseas Indian Affairs', 'NULL', 'NULL', 'NULL');
INSERT INTO table_name VALUES ( '104', 'Arun Jaitley', 'Cabinet Ministers', 'Finance, Corporate Affairs and Defence', 'NULL', 'NULL', 'NULL');
I have written PHP code for generate all queries from excel with sngle click for our production system