Here's the script, no sql error messages either 🙁
$target_path = "gallery/";
$location = $target_path . basename($_FILES['photo']['name']);
$categoryId=$_POST['category'];
if (substr($_FILES['photo']['name'],-3)=="flv")
{
$thumb=$target_path . basename($_FILES['thumb']['name']);
}
else
{
$thumb=$location;
}
if(move_uploaded_file($_FILES['photo']['tmp_name'], $target_path))
{
$sql="INSERT INTO tblphotos (categoryId,caption, location, thumbnail, uploadDate, showPhoto) VALUES ('$categoryId',$caption','$location','$thumb','$uploadDate','1')";
mysql_query($sql) or die(mysql_error());
}