DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login

Import data from excel to mysql

By: rekha singh | 12 Mar 2010 12:52 pm

 Hi,

Is it possible to import the data from excel to mysql database using php coding.I need to satisfy the following condition to append that code:

1.If employee mobile no already exists in database the the record not to inserted(same as email id).

Please help me,if any one have code for to import data from excel,i already have csv import but my client asking to do excel import.

Thanks
 

Comments

Hello,

Yes, you can use Excel Reader Tool For PHP.

You must have to check employee mobile number before inserting data into database.

If u want i will give the source code.

Regards.

By: rekha singh | 12 Mar 2010

HI
I suggest use Navicat software.It is best.
you can use trial for 30 days...
*http://navicat. com/*
 

By: rekha singh | 13 Mar 2010

Hi,

I suggest you to do like this because i have also done like this.

Read the content from Excel and save it as csv and then insert into mysql
database.
Here with i have attached the sample code.

I think it may helps you.

By: rekha singh | 13 Mar 2010

Now i see 2 tasks in your question

1.reading the data from csv file(excel)

2.phone number is not duplicate values
 
For these 2 problems
1. we can read data from the csv file , csv file is a comma separated values in excel and you can read the csv file using normal file read functions and extract the values using ',' separated value.
2. after you got the values check in database if the phone number is existead or not and when creating the database table for this take phone number as primary key
 
By: rekha singh | 18 Mar 2010

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move