PHPMYADMIN problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
d0ct0rteeth
Forum Newbie
Posts: 7
Joined: Mon May 13, 2002 12:37 pm

PHPMYADMIN problem

Post by d0ct0rteeth »

i have a text file (exported from a dos based inventory system) that i tried to insert into the database and when i insert it the browser times out..

so i restart the server go back and i try to reinsert the old text file from yesterday(that i know works)and it still locks up

I do this daily.. never had a problem before... I can insert other files fine (such as pricing and customer data) and I assume that it isn't the text file.. but anything is possible... Im new at this and have nobody else to turn to so any help is appreciated.

Thanks so much
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

How big is the file? Is it trying to insert lots of records, if so try splitting it into 2 files.

If you can increase the server timeout in your php.ini that would solve it, if not, split the file.

Mike
d0ct0rteeth
Forum Newbie
Posts: 7
Joined: Mon May 13, 2002 12:37 pm

Post by d0ct0rteeth »

Thanks for the response

how can you increase the server timeout ?

where is the php.ini file...

Im new at this... I'll keep looking... thanks again.
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

You can only change the php.ini file if you have access to the server, if you are using a host then this is unlikely. On windows it is usually located in c:\winnt or c:\windows, no idea about *nix.

If you can't do this you will need to split the file.

Mike
d0ct0rteeth
Forum Newbie
Posts: 7
Joined: Mon May 13, 2002 12:37 pm

Post by d0ct0rteeth »

thanks i'm on unix so i will have to split the file.

I assume that I can just cut it up in notepad and insert normally?

This wont overide the previous data?

Thanks again mike... you da man.

C-
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

Can you post the first few lines of your file, it probably has something like

drop tablename if EXISTS;

then a create table statement

then the insert statements

Insert into tablename values ("blah"...);
Insert into tablename values ("blah"...);
Insert into tablename values ("blah"...);
etc etc...

If that is the case then you can just split the insert statements between different files and run them, make sure the one with the drop and create table statements is in the first file you run.

Mike
d0ct0rteeth
Forum Newbie
Posts: 7
Joined: Mon May 13, 2002 12:37 pm

Post by d0ct0rteeth »

Here ya go... Thanks so much...

I manually delete the comments of the tables before uploading the text file... I'm sooo lost.. I hope this helps... its formatted funny so I commented it.. I can email it to you if you want...

<here is the first line>

Item Number Description List Price UM Sortclass Brand Name Base Price Weight Stock Print? Condition Sell Qty '0' Updated

<here is the second line>

0-75966-423-4 Practical Home Theater 2002 19.95 EA Books 1st Books 19.95 2 4 Y N 2002-04-09

<here is the third line>

1220-OM Owners Manual. 18.00 EA Manuals 3M 18.00 5 3 Y Y --

<here is the fourth line>

226-1/4-600 .25 inch X 600FT Master Tape 0.00 EA Tape 3M 5.00 5 2 Y N --
d0ct0rteeth
Forum Newbie
Posts: 7
Joined: Mon May 13, 2002 12:37 pm

Post by d0ct0rteeth »

actually ive changed the file so it is disgustingly small now and it still isn't working... :cry:

anyone know how to take a database from one server (my backup server) .. export it.. and import it onto another (primary server..) using phpmyadmin ?

i'll be searching around..

thanks.. you guys rock :D
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

In phpmyadmin, on your left you should see Home and underneath that the name of your database, click this name.

Once the frame loads on your right under all of the table details the is a part "View dump (schema) of database" you can either select certain tables or don't select any tables to export the whole database.

Choose Structure and data
+ Add 'drop table'
+ Complete inserts
+ Send

click Go.

After a short time it will ask for a download location, save it somewhere.

When you want to restore to your other database rather than View dump... just above this is "Run SQL query/queries on database..."
in the "Location of the textfile" either type in the file and its location or browse to it, then click Go.

Mike
d0ct0rteeth
Forum Newbie
Posts: 7
Joined: Mon May 13, 2002 12:37 pm

Post by d0ct0rteeth »

awesome... that looks easy enough...

thanks... i'll let you know how it turns out..

C-

.....................
d0ct0rteeth
Forum Newbie
Posts: 7
Joined: Mon May 13, 2002 12:37 pm

Post by d0ct0rteeth »

thanks shes all fixed...

you the man

C-
Post Reply