Cant get fileupload to store value it mysql

Hello all,
below is a simple piece of php code in which I am trying to move a file from my computer to the server, and 2) store the name of the file in the database. My $con string is intentionally changed for posting purposes. And the page that points to this posts <input type=file size=45 name=file_r>

At this stage, it moves the file fine, but it doesnt store any value for the name of the file and stores everything else from the form, like the name of the file, date, etc…

I would greatly appreciate any help.


<?php
$con = mysql_connect("555555555.secureserver.net","username","******");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db("mombo_buzz", $con);
$sql_auto="SELECT MAX(`iAutoNum`) as iAutoNm FROM `da_conversations`";
$db_auto=mysql_query($sql_auto);
$res_auto=mysql_fetch_array($db_auto);
$iAutoNum=$res_auto['iAutoNm'];
$iAutoNum=$iAutoNum+1;

$groupid=$_POST['vGroup_id'];
if(count($groupid)==0 or !isset($_POST['vGroup_id']))
{
 $sql1="INSERT INTO `da_resources` (`Title`, `Description`, `Usrid`, `Group_ID`, `URL` ,`file_r`,`YouTube`, `Time`, `iAutoNum`) VALUES ('$_POST[Title]', '$_POST[Description]', '$_POST[Usrid]', '$_POST[Group_ID]', '$_POST', '$_POST[file_r]', '$_POST[You_Tube]', NOW(), '".$iAutoNum."')";
 if (!mysql_query($sql1,$con))  {  die('Error: ' . mysql_error());  }
 $resourceid=mysql_insert_id();
 
}
else
{
 for($i=0;$i<count($groupid);$i++)
 {
  $sql1="INSERT INTO `da_resources` (`Title`, `Description`, `Usrid`, `Group_ID`, `URL` ,`file_r`,`YouTube`, `Time`, `iAutoNum`) VALUES ('$_POST[Title]', '$_POST[Description]', '$_POST[Usrid]', '".$groupid[$i]."', '$_POST', '$_POST[file_r]', '$_POST[You_Tube]', NOW(), '".$iAutoNum."')";
  if (!mysql_query($sql1,$con))  {  die('Error: ' . mysql_error());  }
  $resourceid[$i]=mysql_insert_id();

 }
}

$target_path = "../uploads/";
$target_path = $target_path . basename( $_FILES['file_r']['name']); 
if(move_uploaded_file($_FILES['file_r']['tmp_name'], $target_path)) { } else{ }

header("location: ../group_test_test.php?id=$_POST[Group_ID]");
mysql_close($con)
?>