Page 1 of 1

Dumping Only Data

PostPosted: 24. June 2011 16:39
by pplastiras
Hi,

I’m new to this forum and I need some help. I’m trying to export only data from a database using mysqldump method. In a similar use of this method I can export both data and structure using the commant below:

Code: Select all
$creatBackup = "c:/xampp/mysql/bin/mysqldump.exe -u ".$username." --password=".$password." ".$db_name." applications> ".$backupFile;


Where:
$username = database username
$password = database password
$db_name = database name
$backupFile = file name + path

When I use this command, I get a result. But when I’m trying to create a file with only data I take nothing. Please help me!!!!! 

Re: Dumping Only Data

PostPosted: 25. June 2011 02:09
by JonB
OK - here's recipe where you will need to adjust the ingredients

A. -- Start phpMyadmin (http://localhost/phpmyadmin

B. -- selct the database you wish to export (left column) and click to make it the active database

C. -- whent the screeen is refreshed. select the "export' tab.

D. -- you will get a page with all the options to export the data 'only' from the selected database (with too many options to describe).

Good Luck
8)

Re: Dumping Only Data

PostPosted: 25. June 2011 02:49
by pplastiras
Thanks for the help but I want to export database data with a php script.... Sorry, it was my falt I did not explain it well in the previous answer. :D

Re: Dumping Only Data

PostPosted: 25. June 2011 05:49
by JonB
OK, I think I have soem good news for you

BUT my regular internet is out right now :shock:

Re: Dumping Only Data

PostPosted: 25. June 2011 19:06
by pplastiras
I'm waitting for you!!! 8) 8) :lol: :lol: :D :D :D :mrgreen:

Re: Dumping Only Data

PostPosted: 26. June 2011 16:16
by JonB
Well, my regular internet is back (cable problem)

I should point out that every database has different tables and columns, so no matter what you do there will be the matter of proper queries.

There's a way to have phpMyAdmin help you: (I was hoping you would explore there)

You can use either the SQL or Search tabs to create queries that output the results you need.

If you are using the Query Tab, cut/copy the Query and paste it into the SQL Query window

run the Query (see results table) -- when the query is run, you will see an option to 'create PHP code' this will write the query in a form that will return an array that you can use in PHP to output the data (to whatever you want).

I'm quite sure this is not as complete a solution as you may have desired, but read my first point an try to get where its coming from. Any true 'database' is self-defining, so you have to look inside with a tool FIRST, then instruct it what to do in its command language (now almost universally SQL -- Structured Query Language). Also, realize that there really is no such thing as truly 'raw' data, all data has to be structured so the receiver can format it meaningfully. The simplest forms are comma, quote, or tab delimited text. (CSV).

There are other tools such as Navicat, and phpMyEdit (plus many many more) that can help create code. Some are free, others (like Navicat) are just a good investment.

http://www.navicat.com/en/
http://www.phpmyedit.org/

You could also look at this sample, its quite straightforward:
http://www.tutorial5.com/content/view/159/85/

Good Luck
8)

Re: Dumping Only Data

PostPosted: 26. June 2011 17:45
by pplastiras
thanks for your advices. I have already download Navicat and i will explore it. If i find a solution i will let you know. Thanks again for your help. :lol: