473,395 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

need help writing database entires to file

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
2 2852

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers...
2
by: JackM | last post by:
Let me attempt to explain my problem. I have a crude php script that takes a text list of songs that was generated by an mp3 list program and translates each entry into the form where they can be...
3
by: Cherrish Vaidiyan | last post by:
Sir, A Warm and Smart 2004 greetings to all. I have a problem with standby database.I have been posting queries but no response ..... I am using 2 system running on Red Hat Linux9 and...
7
by: cider123 | last post by:
I'm coding a project using the following article as reference: http://www.codeproject.com/csharp/DynamicPluginManager.asp In this type of project, plugins are loaded dynamically into a Plugin...
14
by: Nick Z. | last post by:
I have a file that I want to read a UTF-16 unicode string from. What is the easiest way to accomplish that? Thanks in advance, Nick Z.
0
by: kid4rilla | last post by:
I can successfully write the binary data to an image data type, and successfully retrieve it, but when I attempt to play the file in media player after retrieving it, I get the file type isn't...
1
by: Rizwan | last post by:
I am writing this code for file upload in asp 3.0 on my webpage........ It is working on local system but when i want to upload an image on my website from client machine it is not working ..........
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
5
by: rm | last post by:
When using ADO in a module inside an Access 2003 database do I need to open a db connection even though I am working with a table inside the same database? I am writing a bit of code to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.