By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,729 Members | 1,386 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,729 IT Pros & Developers. It's quick & easy.

need help writing database entires to file

P: n/a
I have used dreamweaver to do a lot of php "programming" but now I need to
write a real php function.

I have a hosted mysql database that I need to export to MS Access. I can't
use myODBC to do it because hosting company denies access to db port. I
looked at other ways to dump the data but the escaped characters always
threw the import off. There probably a way to do using MySQLDUMP command.
HOwever, I remember a long time ago I wrote some code to read raw data into
lotus notes and figured there is probably a way to write out the data using
whatever field & record terminators I choose.

Keeping in mind the end goal is to write on e that is friendly to import
into MS Access, does anyone have an idea of how to use PHP to write a mysql
db out to a *.txt file formatted for easy import to MS Access?

If not, does anyone know how to write a mysql db out to a file?

Many thanks!
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"NotGiven" <no****@nonegiven.net> wrote in message
news:vI******************@bignews4.bellsouth.net.. .
I have used dreamweaver to do a lot of php "programming" but now I need to
write a real php function.

I have a hosted mysql database that I need to export to MS Access. I can't use myODBC to do it because hosting company denies access to db port. I
looked at other ways to dump the data but the escaped characters always
threw the import off. There probably a way to do using MySQLDUMP command.
HOwever, I remember a long time ago I wrote some code to read raw data into lotus notes and figured there is probably a way to write out the data using whatever field & record terminators I choose.

Keeping in mind the end goal is to write on e that is friendly to import
into MS Access, does anyone have an idea of how to use PHP to write a mysql db out to a *.txt file formatted for easy import to MS Access?

If not, does anyone know how to write a mysql db out to a file?

Many thanks!

You can create custom deliniated text files with mysql with
SELECT INTO OUTFILE '/path/to/file/to/create.txt'
FIELDS
TERMINATED BY '\t'
ENCLOSED BY ''
ESCAPED by '\\'
LINES
STARTING BY ''
TERMINATED BY '\n'
FROM ....(where, group by, having, etc)
The values given are the defaults if you don't specify them. Make sure MySQL
has write permissions on '/path/to/file/to/'.
Jul 17 '05 #2

P: n/a
Many thanks. I'll give it a try!

"Phlarmf" <no@email.com> wrote in message
news:p4ekb.122291$pl3.46313@pd7tw3no...

"NotGiven" <no****@nonegiven.net> wrote in message
news:vI******************@bignews4.bellsouth.net.. .
I have used dreamweaver to do a lot of php "programming" but now I need to write a real php function.

I have a hosted mysql database that I need to export to MS Access. I can't
use myODBC to do it because hosting company denies access to db port. I
looked at other ways to dump the data but the escaped characters always
threw the import off. There probably a way to do using MySQLDUMP command. HOwever, I remember a long time ago I wrote some code to read raw data

into
lotus notes and figured there is probably a way to write out the data

using
whatever field & record terminators I choose.

Keeping in mind the end goal is to write on e that is friendly to import
into MS Access, does anyone have an idea of how to use PHP to write a

mysql
db out to a *.txt file formatted for easy import to MS Access?

If not, does anyone know how to write a mysql db out to a file?

Many thanks!

You can create custom deliniated text files with mysql with
SELECT INTO OUTFILE '/path/to/file/to/create.txt'
FIELDS
TERMINATED BY '\t'
ENCLOSED BY ''
ESCAPED by '\\'
LINES
STARTING BY ''
TERMINATED BY '\n'
FROM ....(where, group by, having, etc)
The values given are the defaults if you don't specify them. Make sure

MySQL has write permissions on '/path/to/file/to/'.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.