HI

I hoping that someone will be able to tell me why I am not able to write to my csv file.

Here is my csv file (check.csv):

check, 1

My first php file (qaz.php) changes the value of 1 to 0:

<?php
$handle = fopen ( "check.csv", "rw" );
while( $data = fgetcsv($handle, 1000, ",")) {
echo 'varA = ' . $data[0] . "<br>";
echo 'varB = ' . $data[1] . "<br><br>";
if ( $data[1] == 1 ) {
$data[1] = 0;
fputcsv( $handle, $data[1] );
echo 'varA = ' . $data[0] . "<br>";
echo 'varB = ' . $data[1] . "<br>";
}
}
fclose ( $handle );
?>

I can see the change with this php file, but when I load my second php, there is no changes.

My second php file (qaz2.php) to see if the check.csv changed:

<?php
$handle = fopen ( "check.csv", "r" );
while( $data = fgetcsv($handle, 1000, ",")) {
echo 'varA = ' . $data[0] . "<br>";
echo 'varB = ' . $data[1] . "<br><br>";
}
fclose ( $handle );
?>

Thanks for your help.

Ren