Question
Update recordset fails
Hello,
I have a form to upload images and to insert names and paths into a
database. The images are really uploaded, but the database update
doesn't work. The code is:
mysql_select_db("books");
$sql = "INSERT INTO filestore SET
main_pic1orig='hauptpics/$image_stored',
main_pic1small='hauptpics/$img_name'";
$action = mysql_query($sql);
$sql = "UPDATE hauptliste SET
main_pic1orig='hauptpics/$_POST[main_pic1orig].jpg',
main_pic1small='hauptpics/$_POST[main_pic1small].jpg',
WHERE main_id='$_GET[main_id]'";
$action = mysql_query($sql);
echo "<p><b>Added files:</b></p>";
echo "<p>Original: ".$image_stored."</p>";
echo "<p>Thumbnail: ".$img_name."</p>";
Is there something wrong with that code?
Martin
I have a form to upload images and to insert names and paths into a
database. The images are really uploaded, but the database update
doesn't work. The code is:
mysql_select_db("books");
$sql = "INSERT INTO filestore SET
main_pic1orig='hauptpics/$image_stored',
main_pic1small='hauptpics/$img_name'";
$action = mysql_query($sql);
$sql = "UPDATE hauptliste SET
main_pic1orig='hauptpics/$_POST[main_pic1orig].jpg',
main_pic1small='hauptpics/$_POST[main_pic1small].jpg',
WHERE main_id='$_GET[main_id]'";
$action = mysql_query($sql);
echo "<p><b>Added files:</b></p>";
echo "<p>Original: ".$image_stored."</p>";
echo "<p>Thumbnail: ".$img_name."</p>";
Is there something wrong with that code?
Martin