Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-22-2008, 04:12 AM   PM User | #1
sudhakararaog
Regular Coder

 
Join Date: Sep 2007
Posts: 137
Thanks: 1
Thanked 0 Times in 0 Posts
sudhakararaog is an unknown quantity at this point
importing data into mysql

hi

i need to import data into a table in mysql from phpmyadmin using the
Import option instead of using insert statements.

for example if the table has 10 fields should the file that needs to
be uploaded have the same field names on top and the associated values.

ideally should this be as an excel or csv file or text file.

in each case please advice the format in which the data needs to be
added into the csv/txt file.

please advice.

thanks.
sudhakararaog is offline   Reply With Quote
Old 01-22-2008, 04:17 AM   PM User | #2
Erindesign
Regular Coder

 
Join Date: Apr 2006
Posts: 231
Thanks: 9
Thanked 1 Time in 1 Post
Erindesign is an unknown quantity at this point
I don't understand...

You are importing from excel into mysql? If so, I'm not familiar with how excel has the output format, but I don't think it will be possible without altering the file.

the MySQL imports use strictly SQL code. That's that "INSERT INTO BLA BLA BLA"...

so if u can code sometihng that will alter the data and put it into sql form, or do it by hand, you're screwed.
Erindesign is offline   Reply With Quote
Old 01-22-2008, 05:03 AM   PM User | #3
o0O0o.o0O0o
Senior Coder

 
o0O0o.o0O0o's Avatar
 
Join Date: Jan 2008
Location: C:\Windows\System32
Posts: 1,018
Thanks: 19
Thanked 9 Times in 9 Posts
o0O0o.o0O0o is infamous around these parts
That means you have table already created

In that case you use csv file to import data in sql and just dive the
delimiters in the options

There are ready made scripts also available to import data in sql
o0O0o.o0O0o is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:13 AM.


Advertisement
Log in to turn off these ads.