IT Community - Software Programming, Web Development and Technical Support

Excel to mysql

This is a discussion on Excel to mysql within the Database Support forums, part of the Web Development category; Hi, How to insert the data from excel to mysql table? Regards, S.Ashokkumar...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 10-25-2007, 10:09 PM
write2ashokkumar write2ashokkumar is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 85
write2ashokkumar is on a distinguished road
Default Excel to mysql

Hi,

How to insert the data from excel to mysql table?

Regards,
S.Ashokkumar
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 10-25-2007, 10:42 PM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Post Re: Excel to mysql

hi pal,
it is not possible directly convert excel to mysql server,becoz mysql only convert text file data or csv data into mysql server.

Here....
1.as per my idea,first convert excel into text file or csv file by php,becoz
there is no predefined function or reserved function in mysql

2.finally we feed the data into mysql


Thanks,
Prasath.k
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-26-2007, 10:39 PM
write2ashokkumar write2ashokkumar is offline
D-Web Programmer
 
Join Date: Mar 2007
Posts: 85
write2ashokkumar is on a distinguished road
Default Re: Excel to mysql

Hi,

How to load the data to mysql from CSV / Text file? Give the example.....

Regards,
S.Ashokkumar
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 10-29-2007, 02:13 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Smile Re: Excel to mysql

Hi,
we can get csv or text file from php developer
then place the csv file or text file in server host

Finally,run the below coding

DROP TABLE IF EXISTS bio_test_gastric;
CREATE TABLE bio_test_gastric(
`Therapeutic_Area` varchar(100) default NULL,
`Indication` varchar(100) default NULL,
`Biomarker` text,
`Journal_Reference` text,
`Summary` longtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

LOAD DATA INFILE'/home/www/htdocs/stylelog/test/jeyaseelan/Excelreader/biomarker_master_06222007_Gastric.txt' INTO TABLE bio_test_gastric
FIELDS TERMINATED BY '[##]'
ENCLOSED BY '"'
LINES TERMINATED BY '\t\n';


[##]-> for field termination

"" -> for field enclosing
\t\n -> for line termination

Those are specify in text file

Thanks,
Prasath.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 10-29-2007, 02:14 AM
Murali Murali is offline
D-Web Master
 
Join Date: Feb 2007
Location: India-Chennai.
Posts: 385
Murali is on a distinguished road
Send a message via AIM to Murali
Default Re: Excel to mysql

Hi,

Code:
mysql> LOAD DATA INFILE '<FilePath>' INTO TABLE pet<Your_TableName> FIELDS TERMINATED BY '/t';
Query OK, 9 rows affected, 20 warnings (0.00 sec)
Records: 9  Deleted: 0  Skipped: 0  Warnings: 20

mysql> select * from pet;
+--------+--------+---------+------+------------+------------+----+
| name   | owner  | species | sex  | birth      | death      | id |
+--------+--------+---------+------+------------+------------+----+
| Fluffy | Harold | cat     | f    | 1993-02-04 |            | 28 |
| Claws  | Gwen   | cat     | m    | 1994-03-17 |            | 29 |
| Buffy  | Harold | dog     | f    | 1989-05-13 |            | 30 |
| Fang   | Benny  | dog     | m    | 1990-08-27 |            | 31 |
| Bowser | Diane  | dog     | m    | 1979-08-31 | 1995-07-29 | 32 |
| Chirpy | Gwen   | bird    | f    | 1998-09-11 |            | 33 |
| Whist  | Gwen   | bird    |      | 1997-12-09 |            | 34 |
| Slim   | Benny  | snake   | m    | 1996-04-29 |            | 35 |
|        |        |         |      |            |            | 36 |
+--------+--------+---------+------+------------+------------+----+
9 rows in set (0.00 sec)
__________________
-Murali..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 10-30-2007, 08:45 PM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Talking Re: Excel to mysql

Hi,
can we convert excel data into mysql database not using php?????


Thanks,
Prasath.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing data from excel to MYSQL komal.kukreja PHP Programming 1 06-26-2009 10:54 PM
Extracting excel data into the mysql data using php boylekim PHP Programming 0 12-29-2008 09:48 AM
Importing MS Excel Data into a MySQL database using PHP jamilvoss PHP Programming 0 12-26-2008 11:33 AM
jdbc with excel krishnakumar Java Programming 30 09-13-2007 02:48 AM
upload excel shaalini PHP Programming 1 07-10-2007 11:46 PM


All times are GMT -7. The time now is 06:11 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0