473,563 Members | 2,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to write textfiles with php?

Hey guys.

Anybody has an idea how to write data from mysql source into a textfile?
Thanks for help.

-------------------------------
Fav pages:
PSP Spiele: http://www.psp-spiele.net
XBOX360 Spiele: http://www.xbox360-spiele.net
Aug 13 '05 #1
1 1228
"Micheal Corleone" <31***@web.de > kirjoitti
viestissä:dd*** **********@news .t-online.com...
Hey guys.

Anybody has an idea how to write data from mysql source into a textfile?
Thanks for help.

If you honestly say you couldn't figure it out by reading the manual, you
have bigger problems than that. Anyhow, here's a little example.

$my_result = mysql_query($q = "select * from mytable") or die($q .
mysql_error());
$my_filepointer = fopen("mytextfi le.txt", "w");
while($row = mysql_fetch_arr ay($my_result)) {
fputs($my_filep ointer, implode(';', $row));
}
fclose($my_file pointer);

I'm not gonna debug that, so it may contain errors, but you'll get the basic
idea.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.ber keley.edu/>
Kimmo Laine <et************ ****@5P4Mgmail. com>
Aug 13 '05 #2

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

Similar topics

10
2895
by: Greg Hurlman | last post by:
I've got what I'm sure is a very simple problem. In an ASP page, I am trying to write out 4 fields from a recordset in succession: Response.Write rs("LastName") Response.Write rs("Suffix") Response.Write rs("FirstName") Response.Write rs("MiddleInitial") All fields are populated and are single terms. I would expect...
1
2861
by: techy techno | last post by:
Hii Just wanted to know how can I decorate my texboxes and Listmenu which is called from a JS file using the following code below: document.write("<SELECT NAME='cur2' ONCHANGE='cconv1();'>"); document.write("<OPTION VALUE='0.345066110642241'>Argentina Peso </OPTION>"); document.write("<OPTION VALUE='0.790200069503053'>Australia Dollar
2
2372
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of copying/pasting everytime I change it, I figure this will be better, as I only change it once. The problem is, document.write doesn't handle multiple...
0
1743
by: hari krishna | last post by:
hi all, My requirement is to generate xl reports throu Asp.Net without installing xl on web server computer. i am using Response object and wrtifile method as below. i dont know whether it is correct, but giving error says " file is accessed by other process cannot access" I have some logic inbetween and write the info using response.write...
7
13723
by: CJ | last post by:
Hello! I want to read a large text file (100 mb) and from with in the file i want to take out some lines on a spesific kriteria and make new files. eks. inputfile: 123 hello.. 123 more... 124 text.. 125 text
12
3132
by: Nettan | last post by:
Hi What is the best way to write to a textfile, is it with FileSystemObject or with StreamWriter? Thanks /Nettan
6
7359
by: ericunfuk | last post by:
Hi ALL, I want to read a binary file(it's pic.tif file, I guess it's binary file?), then write it to a new file), I have several questions about this process: When I use fread() to read a chunk of the file into a buffer, when it encounters the end of the file, will the EOF indicator be put into the buffer automatically just as an...
7
6354
by: Prem Parekh | last post by:
I need code that can parse data from log file. The log is pipe delimited and in following format: time=2006-11-03 13:13:56| fw=199.23.48.120| user=tjolen| realm=EMEA| roles=Network Connect| src=24.141.197.139| dstname=| duration=| msg=AUT22670: Login succeeded for tjolen/EMEA. time=2006-11-03 13:14:07| fw=199.23.48.120| user=tjolen|...
9
3584
by: Stef Mientki | last post by:
hello, I want to search multiple textfiles (python source files) for a specific word. I can find all files, open them and do a search, but I guess that will be rather slow. I couldn't find any relevant information through google. Does anyone know of a search library that performs this task fast ?
0
7665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.