₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,328,324 members, 8,435,162 topics. Date: Sunday, 28 June 2026 at 05:39 AM

Toggle theme

How To Insert Excel Data Into My Database - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersHow To Insert Excel Data Into My Database (1016 Views)

1 Reply (Go Down)

How To Insert Excel Data Into My Database by maekhel(op): 8:22am On Sep 06, 2014
Mrng fellow webmaster, am currently building which has to do with upload excel file and insert the data into my database. Am using this script PHPExcel, I can display the excel cells on my page but am having problem inserting the cells into the database. Any help please on how to go about inserting the cells into my database
Re: How To Insert Excel Data Into My Database by pastormustwac: 8:48am On Sep 06, 2014
If you follow the example shown here http://dhtmlhub.com/blogs/15
You should be able to get your excel data as an array. The next issue is how to now parse the array into your database. We need to know the particular problem you are having. I somehow believe it has to do with working with arrays.
Re: How To Insert Excel Data Into My Database by maekhel(op): 8:56am On Sep 06, 2014
Thanks, where am having problem is inserting the array into my database and controlling the order of insertion
Re: How To Insert Excel Data Into My Database by pastormustwac: 11:16am On Sep 06, 2014
You cannever insert an array into your database, you create sql queries for the items while looping through the array.
Re: How To Insert Excel Data Into My Database by maekhel(op): 11:24am On Sep 06, 2014
within the loop I ran d insert query like this:
mysql_query ("insert into table values('$val[1]', '$val[2]')"wink;
Re: How To Insert Excel Data Into My Database by pastormustwac: 12:28pm On Sep 06, 2014
You need to first say

echo '<pre>';
print_r($val);
die();

so that you can get all the fields first, and then you will know what you need to insert, maybe it is:

mysql_query ("insert into table values('$val[3]', '$val[7]') " ;
Re: How To Insert Excel Data Into My Database by dwebdesign(m):
CREATE DATABASE db_name
CREATE TABLE
then create your records
use the INSERT INTO to fill you table.
take an sql lesson @ w3schools.com

and if you need further help, call 08133884165/ mail segzy54@gmail.com
Re: How To Insert Excel Data Into My Database by maekhel(op): 6:48pm On Sep 06, 2014
dwebdesign: CREATE DATABASE db_name
CREATE TABLE
then create your records
use the INSERT INTO to fill you table.
take an sql lesson @ w3schools.com
its not that I can't insert into a database but am having problem reading excel cells and insert it into a database.
Re: How To Insert Excel Data Into My Database by dwebdesign(m): 7:27pm On Sep 06, 2014
Re: How To Insert Excel Data Into My Database by pastormustwac: 6:52am On Sep 07, 2014
^^Abi o, that is another way.
Re: How To Insert Excel Data Into My Database by maekhel(op): 1:13pm On Sep 07, 2014
Thanks guys, have got it working using phpexcelreader
Re: How To Insert Excel Data Into My Database by pastormustwac: 5:04pm On Sep 07, 2014
You are welcome bro.
1 Reply

Reading Different Versions Of Excel Data (CSV,XLS,XLSX) With Phpexcel LibraryHow Can I Link A Form In My Website To A Table In My DatabaseI Need An Asp.net Developer To Make It Possible To Upload Excel Data Into Dbase234

Web Unlimited TrafficI Need Someone To Design My WebsiteGot Adsense For Sale?