View Full Version : MySQL database help

06-02-2004, 09:34 AM
As a newbie, I would like to be able to use the database I have created.

One of the things I would like to be able to do is go into the users database, and dump certain fields, primarily the user id and email address. Particularly for folks that have signed up as users but not created ads as of yet.

I can use phpMyadmin to see the tables, I can even get a Excel proper export, but of all the fields not the limited fields I want.

Anyone know of a quick way to export only selected fields from the tables, and possibly a good reference source for answering these types of questions?


06-02-2004, 10:57 AM
You need to create an sql statement to pull the fields you want.

Something like this if you do it from phpMyadmin (click the sql tab on top and paste this in the box):

SELECT ID,emailAddress FROM `default_UserDB`

06-02-2004, 11:20 AM
After running the query, is there a way (or a function) to get the data exported as a file?

06-02-2004, 11:32 AM
Once you run the sql there is an export function at the bottom of the page.

06-02-2004, 11:40 AM
The export feature only exports the full table, not the queried results? I suppose I could create a new table and force the results into the new table, then export the new table, but it seems like there should already be a function.

Am I running an old version of phpmyadmin? I am not sure but I will check.

06-02-2004, 11:47 AM
On mine it exports just the query results. I'm using phpMyadmin 2.5.6-rc1.

06-02-2004, 12:57 PM
This is what's running on my site.

phpMyAdmin 2.2.7-pl1

MySQL 4.0.17-

To get it to export, is there a selection after running the query, or on the page where the query is created?

06-02-2004, 01:11 PM
On mine there is a selection after running the query. The export selection is at the bottom of the page. See screen print below:

06-02-2004, 01:35 PM
Thanks for the help. I don't know if my webhost has any plans to update the software. I will contact them.

I'm locked in for a while in terms of the contract, so I will suffer with what they have for now.

Thanks again.