Maybe this is where i am going wrong, but I am using dreamweaver for this form.
Right, made a form to insert a record into a mysql db. this works fine, no problem here.
I then copied this form, and then modified it to an update form. The main difference is that that form text boxes are pre-populated from the database, thus allowing easy modifications. however, the box where I browse for the image is empty 😕
the update SQL is:
$updateSQL = sprintf("UPDATE items SET category=%s, item_desc=%s, item_details=%s, price=%s, pp=%s, active=%s, img_path=%s WHERE id=%s",
GetSQLValueString($_POST['category'], "text"),
GetSQLValueString($_POST['item_desc'], "text"),
GetSQLValueString($_POST['item_details'], "text"),
GetSQLValueString($_POST['price'], "double"),
GetSQLValueString($_POST['postage'], "double"),
GetSQLValueString($_POST['active'], "text"),
GetSQLValueString($_POST['img_path'], "text"),
GetSQLValueString($_POST['id'], "int"));
When I load the form in the browser, id is specified in the URL eg. updateform.php ?id=11
when I submit the form I get an arror diplayed in the browser, and the update doesn't happen.
Undefined index: img_path in c:\inetpub\wwwroot\.....etc...
even when I browse for the image once more, so that the text box
<input name="img_path" type="file" value="<?php $row_previous_values['img_path']; ?>" size="32" />
has a file in it, I still get the error.
Undefined index: img_path in c:\inetpub\wwwroot\.....etc...
I do have the form setting enctype="multipart/form-data" set up.....
Any ideas why i repeatedly get the error?
many thanks