print_r($_POST); print_r($_FILES); if (empty($_FILES)) { // header("Location: http://www.formularysolutions.com/imgtag/uploadimage.htm"); echo "file not found"; phpinfo(); exit; } else { $img1 = $_POST['img1']; $ClickPicName = $_POST['ClickPicName']; $ClickIndex = $_POST['ClickIndex']; } //$db = mysql_connect("www.bts-llc-az.com", "nonformulary", "nfml-59287") or die("Can't connect to server."); //mysql_select_db("nonformulary", $db) or die("Can't select database."); $db = mysql_connect("65.100.101.132", "root", "A8988-ace") or die("Can't connect to server."); mysql_select_db("ClickToIt", $db) or die("Can't select database."); $img1_type = $_FILES['img1']['type']; $img1_size = $_FILES['img1']['size']; $img1_name = $_FILES['img1']['name']; $img1_tmp_name = $_FILES['img1']['tmp_name']; $binary_junk = addslashes(fread(fopen($img1_tmp_name, "r"), $img1_size)); //$insert_data = "INSERT INTO WebDatanf ( size, type, Description , BinaryColumn) //VALUES ('$img1_size', '$img1_type', '$img1_name', '$binary_junk')"; $insert_data = "UPDATE ClickListTin SET ClickPicType = '" .$img1_type. "',"; $insert_data .= " ClickPicName = '" . $img1_name . "',"; $insert_data .= " ClickPic = '" . $binary_junk . "'"; $insert_data .= " WHERE ClickIndex = " . $_POST['ClickIndex']; //echo "