Writing to .csv

Discussion in 'PHP' started by tin2mon, Oct 22, 2010.

  1. #1
    Hi All,

    I am using the following code to write to a .csv. Unfortunately, it is not actually writing anything in and my array is not working.

    Any ideas/help/code corrections would be greatly appreciated:

    I know all of the data is being read into through the queries correctly.
     
    tin2mon, Oct 22, 2010 IP
  2. mikecampbell

    mikecampbell Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make sure the directory that Product_Database.csv is going into is writable. Try the following to make sure you can actually write to the file.

    $file = fopen("Product_Database.csv","w");
    fwrite($file, 'test');
    fclose($file);
     
    mikecampbell, Oct 22, 2010 IP