RE: [PHP] Warning: 1 is not a valid File-Handle resource

From: Date: Tue, 03 Apr 2001 16:53:08 +0000
Subject: RE: [PHP] Warning: 1 is not a valid File-Handle resource
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-46848@lists.php.net to get a copy of this message
I had that same warning the other day and the problem was a slight syntax error in my query statement. Jerry Lake - jerryl@europa.com Web Designer Europa Communications - http://www.europa.com Pacifier Online - http://www.pacifier.com -----Original Message----- From: WK [mailto:andrewl36@hotmail.com] Sent: Monday, April 02, 2001 8:35 PM To: php-general@lists.php.net Subject: Re: [PHP] Warning: 1 is not a valid File-Handle resource ""WK"" <andrewl36@hotmail.com> wrote in message news:9abfvp$v4$1@toye.p.sourceforge.net... > $fp2=fopen ("userdata","r")or die("unable to open file > ($userdata)"); > $fp2 is getting a value 1 or 0 > > if ($fp2=fopen ("userdata","r") ) { > lock file > write some stuff unlock file <--------------forgot this > } > else { > echo ("file would not open"); > } > > wk > > ""Richard Kurth"" <rkurth@pacifier.com> wrote in message > news:FGEPLIKKFNGPGLDMFDCLGEOFDBAA.rkurth@pacifier.com... > > I am using the newest ver of PHP and newest ver of apache on win98 > > just installed new php and apache yesterday set php up as a module > > > > > Don't know. Code looks good, what version of PHP are you using? Module > or > > > cgi? What version of windows? These are the things the PHP/Zend guys > > > probably need to know. > > > > > > On 4/2/01 4:59 PM, "Richard Kurth" <rkurth@pacifier.com> wrote: > > > > > > > What is causing this error > > > > > > > > > > > > Warning: 1 is not a valid File-Handle resource in > > > > c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88 > > > > > > > > This is the cod in question > > > > > > > > $tab = chr(9); // define tabulator > > > > if(file_exists("userdata")) { > > > > $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)"); > > > > flock($fp2, 2); //unless ($use_flock == 0); > > > > while ($data = fgetcsv ($fp2, 1000, $tab)) { <---this is line 88 > > > > $num = count ($data); > > > > $row++; > > > > for ($c=0; $c<$num; $c++) { > > > > > > > > } > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-general-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#46848) next »