Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 10th, 2003, 01:55 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default exporting mysql databases

Is there any way to take a mysql database and saving it to disk other than saving all the data and structure as a .txt file or xml file through PHPMyAdmin? Maybe as a spreadsheet or as any other format that is easier to read than the txt file?

Reply With Quote
  #2 (permalink)  
Old August 1st, 2003, 02:17 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Well, in theory that's what the CSV (comma separated values)functionality is for. Exporting to that will allow you to import into say, Excel or other applications.

My suggestion is upgrade to PHPMyAdmin 2.5.1 or later. That version has the CSV functionality built into it. As far as how good it is, I dunno. I haven't fooled with it.

hth,
: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #3 (permalink)  
Old August 1st, 2003, 02:15 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can also just hijack the source of phpMyAdmin to extract what you need. The code there works well -- if you just want to write a small script to do a specific task, that's a good place to start.

It's not terribly hard to write your own script to do it on your own though. For example, here's pseudocode for outputting all your table data into an HTML page:

For each table in the database,
   Output a heading for that table.
   Begin an HTML table.
   For each column in that table,
      Output a table header cell for that column.
   Select * from that table.
   For each row in the result set,
      For each column in the result row,
          Output a table cell for that column.

Simple!


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for Beginning databases with MYSQL sponsora MySQL 3 July 18th, 2008 06:24 AM
MySQL Connect DataBases!!! asadullah SQL Language 1 April 26th, 2007 12:54 AM
Exporting mysql to other formats fold1234 PHP Databases 5 December 5th, 2003 01:48 PM
beginning databases with mysql Dai All Other Wrox Books 0 November 6th, 2003 09:29 AM



All times are GMT -4. The time now is 04:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.