Hi Chris,
This is probably due to a permissions problem on your newsletter
subdirectory. Go to the server and change the newsletter subdirectory's
permissions to be 777 (leaving it that way could be a security hazard,
depending on if you have important information stored in that directory or
not, and if there are other people that could get on the server). Then try
running the script again.

- Jonathan

-----Original Message-----
From: Chris Payne [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2002 1:52 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Saving DB Resuts to a file


Hi there,

I entered the code in as you described below, and it LOOKS on the screen as
thought it is doing it, but when I look at the server there is no output
file, can you see anything obvious that I am doing wrong?

Thanks for your help.

Chris

$connection = mysql_connect("localhost","xxxxxx","xxxxxx") or die("Couldn't
make a connection.");

// select database
$db = mysql_select_db("mailinglist", $connection)
 or die("Couldn't select database.");
 return $connection;

$query = mysql_query("select * from emaillist");
fopen("/web/newsletter/test.txt", w);
while ($row = mysql_fetch_array($query))
{
fwrite("$row[EMail]\n");
echo $row[EMail];
}
fclose("/web/newsletter/test.txt");



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to