Showing results for 
Show  only  | Search instead for 
Did you mean: 

Data not updating in database

Data is not updating in database from php page.

All things were fine, suddenly data is not updating in database. No any error occurs or not showing any error even error log is fine there is not any error reported, however data is not updating in database. Even mailto() is sending to customer data but data is not updating in database. 

$name = $_FILES['file']['name'];
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["file"]["name"]);	  
$fnam= $_POST['fname'];
$mnam= $_POST['mname'];
$lnam= $_POST['lname'];
$fathe= $_POST['father'];
$cni= $_POST['cnic'];
$contac= $_POST['contact'];
$scontac= $_POST['scontact'];
$addres= $_POST['address'];
$emai= $_POST['email'];
$sec= $_POST['sect'];
$share= $_POST['shares'];
$sh1= $_POST['1s1'];
$sh2= $_POST['2s2'];
$sh3= $_POST['3s3'];
$sh4= $_POST['4s4'];
$sh5= $_POST['5s5'];
$sh6= $_POST['6s6'];
$sh7= $_POST['7s7'];
$delop= $_POST['delopt'];
$di= $_POST['dis'];
$do= $_POST['don'];
$comment= $_POST['comments'];

// Select file type
 $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));

 // Valid file extensions
 $extensions_arr = array("jpg","jpeg","png","gif");

$sql = "INSERT INTO submitdetails (fname, mname, lname, father, cnic, contact, scontact, address, email, sect, shares, s1, s2, s3, s4, s5, s6 , s7, delopt, dis, don, evidence, comments)
VALUES ('$fnam', '$mnam', '$lnam', '$fathe', '$cni', '$contac', '$scontac', '$addres', '$emai', '$sec', '$share', '$sh1', '$sh2', '$sh3', '$sh4', '$sh5', '$sh6', '$sh7', '$delop', '$di', '$do', '$name', '$comment')";
 if( in_array($imageFileType,$extensions_arr) ){

if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
	// Upload file

} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
    <!-- Submit Section -->
     <section id="about">
      <div class="container">
       <h1>Thank You...

$to = $emai;
$subject = "New Inquiry from Al-Haram Cattle Farm";

$htmlContent = '
        <title>Welcome to Al haram cattle farm</title>
        <h1>Thanks you for joining with us...! Our Representative call back you soon.</h1>
        <table cellspacing="0" style="border: 2px dashed #FB4314; width: 300px; height: 200px;">
                <th>Name:</th><td>Al haram cattle farm</td>
            <tr style="background-color: #e0e0e0;">
                <th>Website:</th><td><a href=""></a></td>

// Set content-type header for sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// Additional headers
$headers .= 'From:' . "\r\n";
$headers .= 'Cc:' . "\r\n";
$headers .= 'Bcc:' . "\r\n";

// Send email
    $successMsg = 'Email has sent successfully.';
    $errorMsg = 'Email sending fail.';

		   echo $fnam;