Html file uploads & MySQL error

admin

Administrator
Staff member
I have recently added code to allow users to upload an image file using Html forms. Now that I have done this the mysql_query appears to be going a bit nuts!

I know that there is a known bug which causes this sort of thing to start happening when you add file upload stuff to your pages. However, the question is, how do I resolve it?!

Here is the relevent code:
>
>$db = mysql_pconnect("unix2","xxx","xxx");
>mysql_select_db("bargains",$db);
>
>$success = mysql_query($sql, $db);
>
>if (mysql_affected_rows($success) == 1):
>

I am getting an error message from the mysql_affected_rows call. However, even more bizzare, is the fact that the SQL query before it (which is an UPDATE statement) is actually executing! Here is the error message I get:

Warning: 1 is not a MySQL link index

I know that this usually results from the code not having connected to a database, but I have my connection strings written immediately before the mysql_query.

Finally, if I dont specifically supply a file for upload, I dont get these errors, even though the code doesnt change.

Little help would be appreciated!...

Rob Siveter.
 
Back
Top