Welcome Guest, Not a member yet? Register   Sign In
Mysql import and export help
#1

[eluser]Muhammad Waqar[/eluser]
Hi,
I want to make database back using php. Please assist me with this matter. I want to export database in .sql format and also want to import after exporting using php. Any assistance will be appreciate. Thanks in advance.

Waiting for any good response...............
Regard:
Waqar
#2

[eluser]smilie[/eluser]
Have you already done anything yourself or not?

Basically, you would need to read out all DB's on the server and then loop them in PHP and do an export.

Afterwords, do reverse: look up all .sql files in folder and for each found do a PHP import in DB.

Cheers,
Smilie
#3

[eluser]Muhammad Waqar[/eluser]
Thanks for your response.
I have made export database function successfully and it works properly. After that now i am going to make import function but i have not understand how to do it with file field. I know about mysql dump but i think it is not suitable for file field. What you think about import database with file field? have you any idea? If yes please share it.
#4

[eluser]smilie[/eluser]
Hi,

What do you mean with 'file field'?
MySQL has no data type 'file' as far as I know?

Generally, everything you export - can be imported. If you do mysql dump, it will dump 'everything' - hence, everything can be imported later on.

Cheers,
Smilie
#5

[eluser]Muhammad Waqar[/eluser]
hi thank for quick response.
Using html file field i want to upload database.sql file from local drives and interacte with php to import database. I want to import database file using html form file field. Please give me another solution beside mysql dump.
#6

[eluser]smilie[/eluser]
Hi,

I do not get what you want to achieve :-)

Mysql dump will create .sql file on the server itself. Once that is done, you can choose to offer that file to user to download it. Once file downloaded on the users PC, it's stored localy.

Then (later), user goes to your form, selects file to be uploaded (.sql file from above), script uploads the file and executes mysqlimport script - or you create PHP import script which will use uploaded file.

I would not know other solution beside mysql dump - but for sure - there are plenty around there on internet...

Good luck,
Smilie
#7

[eluser]Muhammad Waqar[/eluser]
Thanks for quick response..
Ok let me know mysql dump export and import methodoly please. I will be appriate for you if you solve my problem.
Waiting for your response................ Thanks
#8

[eluser]smilie[/eluser]
Well, to be honest - I will not help you solve your problem as I have planty of my own.
However - if you yourself start making a script - and when you bump into a problem - let us know *exact* problem so we may try to help you.

As I said - google a bit around for PHP mysql dump and PHP mysql import...

Cheers,
Smilie
#9

[eluser]Muhammad Waqar[/eluser]
Ok Dear very very thanks for this discussion. I have solved this problem. See you again InshaAllah.




Theme © iAndrew 2016 - Forum software by © MyBB