creating and ftp text file
| From: | Petre Agenbag | Date: | Tue, 05 Nov 2002 14:01:47 +0000 |
| Subject: | creating and ftp text file | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122772@lists.php.net to get a copy of this message | ||
HI
I need to create a text file that is in a specific format from a mysql
query, and then ftp that file to another server.
The format will be something like this:
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Cellphone: xxxxxxxxxx
Reference: 123456
Notify: 0
Validity: 2h
text message
As you can probably deduct, this is for sending SMS message.
The xxxxxxxxx are the numbers that I will be getting from a mysql query,
I am pretty up to standard with getting stuff into and out of mysql, so
I am basically just in need of pointers with generating the text file
and ftp'ing automatically.
It would be an even greater plus if it wasn't actually necessary to
create a physical text file on the hard drive, but to simply ftp the
"memory" file via the ftp functions, but I don't think that is possible?
My routine will already have connections to the db, and the query will
have already been run
(something like select number from table where group=1)
and I would then have a while to step through the result set.
This is where I need help, how to "create" the file and add the numbers
and "static" text to the file, and once completed with the loop, to ftp
to a server with username and password.
Thanks