Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I am trying to write to a file on the server. When I try opening the file I getCode: Select all
fopen(file.csv): failed to open stream: Permission denied in path/to/file.csv
Code: Select all
if(file_exists("./file.csv"))
{
chmod("./file.csv", 0755);
$fp = fopen('./file.csv', 'w');
$query = "SELECT name
FROM names
WHERE name = 'Jim'";
$result = mysql_query($query);
while($row = mysql_fetch_row($result))
{
fputcsv($fp, $row[0]);
}
fclose($fp);
}
Code: Select all
chmod(): Operation not permittedThanks,
pickle | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]