|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-11-18 18:45 UTC] volker at vskm dot org
If you try to upload a file with a HTML form any MySQL-Link gets lost.
Example:
<?php
$conn=mysql_connect(HOST,USER,PASSWORD);
$db=mysql_select_db(DBNAME,$conn);
mysql_query("select max(id) from TABLE",$db);
?>
<html>
<form enctype="multipart/form-data" method="POST">
<input type="file" name="uploadfile">
<input type="submit">
<form>
</html>
If you choose a file this error occurs: Warning: 1 is not a MySQL link index in FILENAME on line 4
Without choosing a file everthing is OK.
I can't say anything about the configuration because I'm only consumer of vservers.com, but you
may look at http://www.vskm.org/errors/phpinfo.php3 where you can see the output of the
phpinfo() function.
Same error occurs in PHP Version 3.0.7 which is part of
the SuSE Linux 6.1 distribution.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 23:00:01 2025 UTC |
In the snippet provided, you are not providing the mysql_query() function with a link identifier, as described in the manual. Try: mysql_query("select max(id) from TABLE",$conn); ^^^^^ Same goes for msql.