Re: Basic Question about closing a file

From: Date: Thu, 12 Sep 2002 19:45:43 +0000
Subject: Re: Basic Question about closing a file
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-15782@lists.php.net to get a copy of this message
Why are you opening it twice? -- Scott Carr OpenOffice.org Documentation Maintainer http://documentation.openoffice.org/ Quoting Arthur <artzan@rogers.com>: > The file in the code below is not closing successfully. Variable $FC = 1. > Can someone tell me what is going on? > Thanks > Arthur > > > $OpenCSV = fopen ($FileCSV, "w"); > if ($OpenCSV = fopen ($FileCSV, "w")) { > print ("The Sales CSV file was opened successfully<BR>\n"); > } else { > print ("The query could not be executed!<BR>\n"); > } > while { // stuff is happening w/ database and calculations here > fwrite ($OpenCSV, "$Orders_id,$Products_id, etc ...\n");} > > $FC = fclose ($OpenCSV); > if (fclose ($OpenCSV)) { > print ("The Sales CSV file was Created successfully$FC<BR>\n"); > } else { > print ("The Sales CSV could not be executed!$FC<BR>\n"); > } > > -- > ----------------------------------------------------- > Click here for Free Video!! > http://www.gohip.com/free_video/ > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/

« previous php.windows (#15782) next »