472,967 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,967 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 2833

"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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.