Re: PHP 4.0 Bug #2757 Updated: MySQL-Connection gets lost at file upload
| From: | Volker Kueffel | Date: | Thu, 25 Nov 1999 18:11:12 +0000 |
| Subject: | Re: PHP 4.0 Bug #2757 Updated: MySQL-Connection gets lost at file upload | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-13115@lists.php.net to get a copy of this message | ||
Hi,
"getting lost" was perhaps a wrong formulation. It would have
been better to say the connection won't open.
I try to explain it again:
If you have a page with a form with input type file and submit
it to another page, that opens a MySQL link you get this
"Warning: 1 is not a MySQL link index..." error message.
My example was very short; it's a page that submits the
form to itself and opens a senseless database connection.
It was just to demonstrate the problem in a very short
script. You may make 2 pages of it:
page1.html:
-----------
<html>
<form enctype="multipart/form-data" method="POST"
action="page2.php3">
<input type="file" name="uploadfile">
<input type="submit">
<form>
</html>
page2.php3:
-----------
<?php
$conn=mysql_connect(HOST,USER,PASSWORD);
$db=mysql_select_db(DBNAME,$conn);
mysql_query("select max(id) from TABLE",$db);
?>
<html>
foo bar
</html>
There will always be an error if you choose a file. And no error if
you do not choose one.
Bye,
Volker
At 16:33 25.11.99 +0000, you wrote:
>ID: 2757
>Updated by: zeev
>Reported By: volker@vskm.org
>Status: Open
>Bug Type: MySQL related
>Assigned To:
>Comments:
>
>What do you mean by it getting lost?
>
>Are you submitting a file upload to a PHP page that has
>a MySQL link opened in it? Does it not open? Does it open
>and then suddenly close?
>
>I'm not sure if the example you enclosed represents a single file (in which
>case it's a really weird script) or two files, in which case I don't
>understand when the SQL handle may get lost...
>
>Full Bug description available at:
>http://bugs.php.net/version4/?id=2757
>