uploading db

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Alicia
New php-forum User
New php-forum User
Posts: 94
Joined: Sun Sep 21, 2003 5:30 pm

uploading db

Postby Alicia » Thu Sep 25, 2003 5:35 pm

Hi,

I need you guys to advise on this. I have downloaded and edited one of the db by using MS Excel.. Now i wanna upload it back to existing table, how could i do that ???

For your information, i am using myphpadmin.. i dun see any link i can click to upload my db.. i know how to dump but dunno how to upload back,,,

Please advise...

User avatar
swirlee
Moderator
Moderator
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Re: uploading db

Postby swirlee » Thu Sep 25, 2003 8:03 pm

Alicia wrote:I need you guys to advise on this. I have downloaded and edited one of the db by using MS Excel.. Now i wanna upload it back to existing table, how could i do that ???

For your information, i am using myphpadmin.. i dun see any link i can click to upload my db.. i know how to dump but dunno how to upload back,,,


I'm going to assume that you're using MySQL, since you mentioned PHPMyAdmin. Here's the problem: MS Excel is a spreadsheet application. It's not a database application. It's not intended to edit database information and should not be used as such for any reason. I can only assume that you downloaded the data as CSV or tab-delimited or something in order to open it into Excel. It's not going to be easy to get it back into MySQL. Essentially you're going to have to delete all of the rows in the entire table and then do some pretty complicated transforms in order to get it into some format that MySQL understands (e.g. INSERT statements).

In other words, you went at this problem entirely in the wrong direction. If you wanted to modify the information in the database, you should have done so directly, using SQL queries through PHPMyAdmin. Do not use Excel to edit the contents of a database -- you can think of this as the equivalent of using Photoshop to write a mathematical proof. It's just too difficult to bother.

Alicia
New php-forum User
New php-forum User
Posts: 94
Joined: Sun Sep 21, 2003 5:30 pm

Re: uploading db

Postby Alicia » Thu Sep 25, 2003 9:19 pm

Actually i need to edit more than 1000 of records and editing it by using sql might takes too much of my time.

Is there any other ways i can edit my records from other table then upload the edited records to another table according to columns/fields name ?

Please advise.

psychomantum
New php-forum User
New php-forum User
Posts: 10
Joined: Sat Dec 07, 2002 8:04 pm

Postby psychomantum » Thu Sep 25, 2003 9:29 pm

I would think if you are using PHPMyAdmin you could just edit your database from there.

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Excel

Postby ruturajv » Thu Sep 25, 2003 9:44 pm

First save a .csv file from exel and then upload the contents
using the

Code: Select all

load data infile '/file/path/thefile.csv' into .....

Alicia
New php-forum User
New php-forum User
Posts: 94
Joined: Sun Sep 21, 2003 5:30 pm

Re: uploading db

Postby Alicia » Thu Sep 25, 2003 11:16 pm

what i did is i dump it to csv for excel.... then i press go ( i didn't save file)... when they dsiplayed all the data, i select all and copied all into wordpad and saved it as text document... then i opened the text doc i just saved by using excel.. so i set semicolon as sign to separate between fields/column (makes it easy for me to view data from different field... when the time i save it, it seems like the semicolon is not there any more and then i did save it in csv format,.,, but it does not seem to work...


thats why i am wondering you may give a an advise in this ...

p.s: i would like to know how to mearge to table (with same id) and merge two fields (side by side) <-- is this possible ????


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests