Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,749 members, 7,824,158 topics. Date: Saturday, 11 May 2024 at 01:07 AM

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

Nairaland Forum / Science/Technology / Webmasters / How To Insert Excel Data Into My Database (920 Views)

Reading Different Versions Of Excel Data (CSV,XLS,XLSX) With Phpexcel Library / How Can I Link A Form In My Website To A Table In My Database / I Need An Asp.net Developer To Make It Possible To Upload Excel Data Into Dbase (2) (3) (4)

(1) (Reply) (Go Down)

How To Insert Excel Data Into My Database by maekhel(m): 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

1 Like

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(m): 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(m): 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): 6:11pm On Sep 06, 2014
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(m): 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(m): 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)

How To Block Ads On Android Device To Save Data Plan / How Can I Sending Bulk Email / How To Prevent Your Wordpress Blog From Crashing

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.