473,396 Members | 1,827 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,396 software developers and data experts.

Backing up a database table with PHP

I would like to backup a database table using PHP (I can't use the simpler
shell command for MySQL). I came across a line of code to do write the
table into a file, so mine is as follows:

$res = mysql_query("SELECT * INTO OUTFILE 'php\admin\db.csv' FIELDS
TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\\' LINES
TERMINATED BY '\r\n\' from $TableName");

$TableName already declared, and the right database is open (using echo
command to print the variables to make sure).

But when the script is run, the file is indeed created in the correct
directory, but is completely blank (zero bytes in length).

I do not know what I'm doing wrong, and this function is not too well
documented - at least - especially not for a newbie. Can anyone help me?

Thanks

Dariusz
Jul 17 '05 #1
0 1239

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ike | last post by:
I am running off of a MySQL database on a remote server. I am truly concerned about backup. I have phpMyAdmin running on the remote server, and I see I can "Export" to various formatsd from there,...
5
by: mark | last post by:
Hi I'm hoping that some could point me in the right direction for "best practice" in: 1) securely backing up a complete sql7 and 2000 server containing many databases. 2) backing up an...
1
by: Hlpl | last post by:
Hi I have a VB.net windows application that uses an MSDE database I need to give the user the option to backup this data (and later restore it). Ideally I want to back the data up to an empty...
9
by: J. Frank Parnell | last post by:
hello, i dont know asp at all, but i have been asked to backup a database that is used on a site which uses .aspx. i dont need to do anything with it, just copy it and send it along to someone...
10
by: Lyle Fairfield | last post by:
I have a tiny db on a remote sql server. The owner of the sever backs up the db daily, but these backups are not freely available to me. I want my data (only my data) backed up in some form that is...
1
by: Pavs | last post by:
This may not be the place to ask however i am looking for resources on how i may document data I am backing up from an oracle database to MS Access. Basically I have my oracle database and i...
5
by: rdemyan via AccessMonster.com | last post by:
I have code in my front end that opens a form for backing up the front end. I'll give a brief description of what the form does: 1) When the backup form opens, it closes all open forms except for...
1
by: rob.w | last post by:
I am new to MySQL. I have an application using MySQL running on Windows Server 2000. If I were using Microsoft SQL Server 2000, I would need special software to back up an open SQL Server database....
1
by: Akaketwa | last post by:
Guys may yu assist me am stuck. Am using v8.1 db2 database on Suse Linux running on an IBM pSeries server. I am aware of the backup utility in db2. I would like to back up the my db2 database to a...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.