the line:
PHP Code:
$result = mysql_query("insert into images (filename, caption) values('".$_FILES["file"]["name"]."',mysql_real_escape_string($_POST['caption'])");
should have been
PHP Code:
$result = mysql_query("insert into images (filename, caption) values('".$_FILES["file"]["name"]."','".mysql_real_escape_string($_POST['caption']."')");
Please be more alert when you just snatch some code up, this is even an easy one , the error points out the line number and all.
You can't expect everything you're beein presented with as beeing handed over on a silverplatter.